CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Location
    Baytown, TX, United States
    Posts
    23

    If..Then..Else Statements with check boxes

    How do I code check boxes in an If..Then..Else statement?

    kazooie21

  2. #2
    Guest

    Re: If..Then..Else Statements with check boxes

    you can do something like this:

    Dim Check1var as Boolean

    Check1var = Check1.Value 'This puts the value of the checkbox in the variable

    If Check1var = true then
    MsgBox "Check1 is Checked"
    else
    MsgBox "Check1 is Not Checked"
    End If






  3. #3
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: If..Then..Else Statements with check boxes

    Kazooie,
    Check Box normally have two values 1 for checked and 0 for NOT checked.
    Not only IF...THEN...ELSE..ENDIF But like FOR...NEXT... WHILE...WEND etc can be used to assign or to check the check box status.
    IF...THEN...ELSE...ENDIF Block is mainly used to check or to assign the values to check Box. A small example -

    Selected = false
    if check1.value = 1 then
    Selected = true 'Selected is a boolean variable
    endif






    Santulan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured