DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Visual Basic 2008, Dim help needed.  (Read 3,661 times)

RedPillow

  • Pillows.
  • Member
  • Joined in 2008
  • **
  • Posts: 141
Visual Basic 2008, Dim help needed.
« on: October 07, 2009, 05:40 PM »
I`ll go straight to the point.

When the program starts, it does this:

Code: (vb)
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: (vb)
Button1.onclick
     If checkbox1.checked then
              checkedboxes = checkedboxes + 1
End 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.
« Last Edit: October 07, 2009, 06:09 PM by jonzku777 »

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
Re: Visual Basic 2008, Dim help needed.
« Reply #1 on: October 07, 2009, 05:59 PM »
Try asking at

http://vbaexpress.com/forum/

Original address: https://www.donationcoder.com/forum/index.php?topic=20203.0