topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 12:56 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

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

RedPillow

  • Member
  • Joined in 2008
  • **
  • Posts: 141
  • Pillows.
    • View Profile
    • Read more about this member.
    • Donate to Member
Visual Basic 2008, Dim help needed.
« on: October 07, 2009, 12:40 PM »
I`ll go straight to the point.

When the program starts, it does this:

Code: Visual Basic [Select]
  1. 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 [Select]
  1. Button1.onclick
  2.      If checkbox1.checked then
  3.               checkedboxes = checkedboxes + 1
  4. End if
  5.               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, 01:09 PM by jonzku777 »

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: Visual Basic 2008, Dim help needed.
« Reply #1 on: October 07, 2009, 12:59 PM »