CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: CheckBox simple

  1. #1
    Join Date
    Feb 2005
    Posts
    42

    Unhappy CheckBox simple

    how to check the checkbox by code?

  2. #2
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Re: CheckBox simple

    Quote Originally Posted by Anandforyou
    how to check the checkbox by code?
    Try...
    Code:
    SendMessage(BM_SETCHECK, BST_CHECKED, 0); // To Check...
    SendMessage(BM_SETCHECK, BST_UNCHECKED, 0); // To UnCheck...
    Hope this helps,
    Regards,
    Usman.

  3. #3
    Join Date
    Apr 2000
    Location
    Boston
    Posts
    124

    Re: CheckBox simple

    Quote Originally Posted by usman999_1
    Try...
    Code:
    SendMessage(BM_SETCHECK, BST_CHECKED, 0); // To Check...
    SendMessage(BM_SETCHECK, BST_UNCHECKED, 0); // To UnCheck...
    Hope this helps,
    Regards,
    Usman.
    There is also:

    Code:
    CButton *pCheckBox = (CButton *)GetDlgItem( IDC_MY_CHECKBOX);
    pCheckBox->SetCheck( BST_CHECKED ); // To Check...
    pCheckBox->SetCheck( BST_UNCHECKED ); // To UnCheck...
    Both work.

  4. #4
    Join Date
    Feb 2005
    Posts
    42

    Re: CheckBox simple

    thanks. both works well.

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