如何使复选框在Win32的? [英] how to make checkbox in win32?
问题描述
一个简单的问题,我找不到我需要的东西,如何仅使用CreateWindow函数中的代码,不使用Visual C ++,不使用其他帮助程序(仅使用Windows.h)在win32中创建复选框?我想要简单的示例,以及如何使用它?
我还在学习c ++和win32,所以不了解大多数内容,msdn也没有提供太多信息。
simple question and I couldn't find what I need, how do you make check box in win32 using only code using CreateWindow function, no visual c++, no additional helping programs, just windows.h? I want simple example, and how to use it?
I'm still learning c++ and win32 so don't understand most of the stuff, msdn doesn't give much info either.
推荐答案
在CreateWindowEx()的参数中,类名称应为BUTTON,窗口样式应为BS_CHECKBOX。两者都是Windows中定义的内置常量。h
In the arguments to CreateWindowEx(), the class name should be BUTTON, and the window style should be BS_CHECKBOX. Both are built-in constants defined in Windows.h
hWnd = CreateWindowEx(NULL,BUTTON,"Checkbox",BS_CHECKBOX,xPos,yPos,width,height,parent,NULL,NULL,NULL)
您只需处理它的消息就像在其他任何窗口中一样。
You would handle it's messages just as you would those from any other window.
这篇关于如何使复选框在Win32的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!