Checkboxes not Checking?

This is a discussion on Checkboxes not Checking? within the Windows Programming forums, part of the Platform Specific Boards category; I have a dialog box with a check box When the user clicks on the checkbox, it does not check. ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    21

    Checkboxes not Checking?

    I have a dialog box with a check box
    When the user clicks on the checkbox, it does not check. Why? I noticed that if I make the code check a different checkbox than the one thats being clicked, it works
    Here is my dialog code
    Code:
    HWND Signon;
    BOOL CALLBACK SomeDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
    {
        switch(Message)
        {
            case WM_COMMAND:
                switch(LOWORD(wParam))
                {
                    case IDC_CHK_AUTO:
                    {
                        SendDlgItemMessage(Signon, IDC_CHK_AUTO, BM_SETCHECK, BST_CHECKED, 0);
                        break;
                    }
                    case WM_CLOSE:
                    case WM_DESTROY:
                        DestroyWindow(Signon);
                        break;
                }
            break;
            default:
                return FALSE;
        }
        return TRUE;
    }

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,264
    comment out:
    SendDlgItemMessage(Signon, IDC_CHK_AUTO, BM_SETCHECK, BST_CHECKED, 0);

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    21
    Tried it and didn't work

    I should probably add that my control resource thing is this:
    Code:
      CHECKBOX "Auto", IDC_CHK_AUTO, 6,49,150,9

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Use the BS_AUTOCHECKBOX style.
    Code:
      CHECKBOX "Auto", IDC_CHK_AUTO, 6,49,150,9, BS_AUTOCHECKBOX | WS_TABSTOP

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    21
    Works now, thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 10:38 AM
  2. Overflow and range checking for mul/div
    By Elysia in forum C++ Programming
    Replies: 28
    Last Post: 06-06-2008, 03:09 PM
  3. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 06:59 PM
  4. Forced moves trouble!!
    By Zishaan in forum Game Programming
    Replies: 0
    Last Post: 03-27-2007, 07:57 PM
  5. Problems about gcc installation
    By kevin_cat in forum Linux Programming
    Replies: 4
    Last Post: 08-09-2005, 10:05 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21