-
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;
}
-
comment out:
SendDlgItemMessage(Signon, IDC_CHK_AUTO, BM_SETCHECK, BST_CHECKED, 0);
-
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
-
Use the BS_AUTOCHECKBOX style.
Code:
CHECKBOX "Auto", IDC_CHK_AUTO, 6,49,150,9, BS_AUTOCHECKBOX | WS_TABSTOP
-