有关动态增加控件

kaiwen820223 2006-07-12 11:49:43
各位大虾,请问如何动态向对话框上增加控件?比如增加一个picture控件,并设置其属性。
...全文
129 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
mimong_lin 2006-07-13
  • 打赏
  • 举报
回复
先定义一个类型指针,然后调用create就可以了。
折腾_苏州 2006-07-13
  • 打赏
  • 举报
回复
CStatic* pStatic = new CStatic();
pStatic->Create(NULL,SS_BITMAP|WS_VISIBLE,CRect(0,0,100,100),this);
//CRect(0,0,100,100)为控件位置
static CBitmap hbmp;
hbmp.LoadBitmap(IDB_BITMAP); //装载位图
pStatic->SetBitmap((HBITMAP)hbmp);
cenchure 2006-07-13
  • 打赏
  • 举报
回复
add control variant ( m_cCtrl ) to you application class , then you can use like this:
m_cCtrl.Create(.x,y....);
the position is important .you can use: GetClientRect(hMainWnd,&rc) or GetWindowRect(hMainWnd,&rc) ;
吹雪 2006-07-13
  • 打赏
  • 举报
回复
CStatic static;
static.Create(......);
ModifyStyle(static.m_hWnd,ws_xxx,ws_xxx,0);
.
.
.
kaiwen820223 2006-07-12
  • 打赏
  • 举报
回复
请问什么意思?
pp7765 2006-07-12
  • 打赏
  • 举报
回复
m_wnd.Create(this,ID,rc)

15,976

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧