使用SDK如何动态创建按钮和文本框? thanks! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 需要创建的时候直接CreateWindow呀,位置自己设定Button 的风格是 BS开头的Edit的是ES_开头的看看msdn CreateWindow函数 HWND btnhwnd=CreateWindow("button", //class name"caption",BS_PUSHBUTTON, //风格x, //坐标和长 高y,width,height,windowhwnd, //父级窗口的HWND,就是这个Button创建在那个窗口里NULL,NULL,NULL,)HWND btnhwnd=CreateWindow("edit", //class name"text",ES_CENTER, //风格 x, //坐标和长 高y,width,height,windowhwnd, //父级窗口的HWND,就是这个Button创建在那个窗口里NULL,NULL,NULL,)更多详情参见http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindow.asp Yes, use CreateWindow or CreateWindowEx.If you want to create a Button, you should give "button" as the class name, similarly create Edit Control with "edit". 自绘按钮背景透明的问题 关于《深入浅出MFC》中模拟消息映射部分中的一个指针的疑问 鼠标不显示??? 'VarCmp' : function does not take 4 parameters 如何提升进程权限 在CDC上绘图,如何保存为bmp格式 求助,wparam参数类型的问题。 文件读写问题? VC++, C++, VC.net, C#他们有什么去俄 关于数据源的连接 VC到底该怎么学 初学者:数据库打印
Button 的风格是 BS开头的
Edit的是ES_开头的
看看msdn CreateWindow函数
"button", //class name
"caption",
BS_PUSHBUTTON, //风格
x, //坐标和长 高
y,
width,
height,
windowhwnd, //父级窗口的HWND,就是这个Button创建在那个窗口里
NULL,
NULL,
NULL,
)HWND btnhwnd=CreateWindow(
"edit", //class name
"text",
ES_CENTER, //风格
x, //坐标和长 高
y,
width,
height,
windowhwnd, //父级窗口的HWND,就是这个Button创建在那个窗口里
NULL,
NULL,
NULL,
)
更多详情参见
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindow.asp
If you want to create a Button, you should give "button" as the
class name, similarly create Edit Control with "edit".