ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Visual Basic 2008, Dim help needed.

(1/1)

RedPillow:
I`ll go straight to the point.

When the program starts, it does this:


--- Code: Visual Basic ---Dim checkedboxes As Integer = 0
I got 5 checkboxes, an I  want that the program adds 1 to the dimmed integer if some of those checkboxes are checked.

Like this:

[ ]
[ x ]
[ ]
[ x ]
[ x ]

3 boxes checked.

Next thing I want to do is for program to create a msgbox which says something like "you checked +checkedboxes boxes"

So what should I do now?

*EDIT*
I fixed it a bit, but its acts weirdly now:


--- Code: Visual Basic ---Button1.onclick     If checkbox1.checked then              checkedboxes = checkedboxes + 1End if              MsgBox ("you checked" + (checkedboxes) + "boxes")
If it`s done like that, the program starts to count letters from "you checked" thingy and makes messagebox which says me for example Y if 1 box checked and O if 2 boxes checked and U if 3 boxes checked, so what could be wrong now?

P.S Those forums you suggested, takes months to get answer + I`d rather ask here =]

I know this is just stupid ask, but I really don`t get the idea of how to do it :/
Please help, thanks.

AndyM:
Try asking at

http://vbaexpress.com/forum/

Navigation

[0] Message Index

Go to full version