CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2000
    Location
    Hawaii
    Posts
    19

    Checkboxes and Label captions

    Please help...How do you make a checkbox control associate itself with a label control...for example, using a checkbox control I want to be able to hold the current label caption and as long as it's checked it won't change...it's like a combination of a slot machine (to randomize) and a poker game (to hold a number displayed)...Can anyone show me how to code it...I've been working on it for days now...Please help - thank you very much.


  2. #2
    Join Date
    Jul 2000
    Posts
    124

    Re: Checkboxes and Label captions

    You can use the click event of the checkbox.

    if chkbox.value = checked then
    label.caption = "Some caption"
    else
    label.caption = "Some other caption"
    end if

    Hope this helps!


  3. #3
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Checkboxes and Label captions

    Just to add... if I'm not mistaken, that should be vbChecked instead of just checked

    -Cool Bizs

    Good Luck,
    -Cool Bizs

  4. #4
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Checkboxes and Label captions

    Just to add... both checked and vbChecked can be used. Same goes for unchecked and vbUnchecked.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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