windows programming
To create a message box in windows programming in dev c++ , we use
messagebox function.. similarly how can we make a check box in windows programming. is there a function for this .
thanks in advance
There is no Checkbox() fcuntion...
You might want to check out MFC.
Usually you create your window with it's various controls using a resource
editor and then let MFC load it for you.
Also you can use CreateWindow with the appropriate class name to cerate a checkbox
(I think).
Hope this helps.
You might want to check out MFC.
Usually you create your window with it's various controls using a resource
editor and then let MFC load it for you.
Also you can use CreateWindow with the appropriate class name to cerate a checkbox
(I think).
Hope this helps.
In native Win32, you create a checkbox by specifying the BUTTON class and the BS_AUTOCHECKBOX style on a child window:
...where parentWindow is the handle of your main window and id is an integer that uniquely identifies the control. More information on using checkboxes can be found here.
HWND checkBox = CreateWindowEx(0, L"BUTTON", L"Check me!", BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD, 10, 10, 100, 25, parentWindow, (HMENU) id, NULL, NULL);
...where parentWindow is the handle of your main window and id is an integer that uniquely identifies the control. More information on using checkboxes can be found here.
The L prefix specifies a Unicode string literal, which enables you to display extended character sets. You can disable Unicode settings in your project's configuration properties.
The id is simply an identifier for the checkbox. For example, you can check the state of a particular checkbox by passing its identifier to IsDlgButtonChecked().
The id is simply an identifier for the checkbox. For example, you can check the state of a particular checkbox by passing its identifier to IsDlgButtonChecked().
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement