怎样改变对话框的大小啊?hellp!!!!!!!!!111

homeyang 2004-06-21 06:20:48
如题。最好给一段代码出来看看!小弟是新手
...全文
323 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
CsdnRob 2004-07-02
  • 打赏
  • 举报
回复
http://www.hooji.com 、有原码下载
zhangnanonnet 2004-06-22
  • 打赏
  • 举报
回复
movewindow()
carbon107 2004-06-22
  • 打赏
  • 举报
回复
方法多多啊MoveWindow()或SetWindowPos
taianmonkey 2004-06-22
  • 打赏
  • 举报
回复
GetWindowRect(&m_rcMain);//restore the src screen's size;
//delete the showing window's caption
LONG style = GetWindowLong(m_hWnd,GWL_STYLE);
style &=~WS_CAPTION;
//set the window's show sytle
SetWindowLong(m_hWnd,GWL_STYLE,style);
//get the screen's pixel
int screenX = GetSystemMetrics(SM_CXSCREEN);
int screenY = GetSystemMetrics(SM_CYSCREEN);
//show window
SetWindowPos(NULL,0,0,screenX,screenY,SWP_NOZORDER);
Flood1984 2004-06-22
  • 打赏
  • 举报
回复
不用得到当前窗口句柄,MoveWindow是窗口类的成员函数,
比如你当前的对话框类名是 CYourDig ;
程序如下:
/*---程序运行到要改变窗口大小的地方---*/
CRect rc(0,0,400,300);
CYourDig.MoveWindow(&rc);

就行了
stevecrisewu 2004-06-22
  • 打赏
  • 举报
回复
MoveWindow
SetWindowPos

up up up up
BBirdlyh 2004-06-22
  • 打赏
  • 举报
回复
MoveWindow SetWindowpos
改变窗口的大小和位置,后者还能改变窗口的z顺序
lixiaosan 2004-06-22
  • 打赏
  • 举报
回复
MoveWindow()
SetWindowPos()
都行
homeyang 2004-06-21
  • 打赏
  • 举报
回复
up
homeyang 2004-06-21
  • 打赏
  • 举报
回复
是不是要得到当前的窗口句柄再用MoveWindow来改变大小啊?怎样得到当前的窗口句柄呢?
hcj2002 2004-06-21
  • 打赏
  • 举报
回复
用 WM_SIZE 消息的OnSize()用movewindow()

一个改变Edit大小的:

void CEditDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
CRect rect;
GetClientRect(&rect);
CEdit *pEdit =(CEdit*)GetDlgItem(IDC_EDIT1);
if(pEdit)
{
pEdit->MoveWindow (&rect);
}

// TODO: Add your message handler code here
}


homeyang 2004-06-21
  • 打赏
  • 举报
回复
请问你们的这些代码要放到程序的什么地方?小弟很菜,请赐教
Jimmy_Xia 2004-06-21
  • 打赏
  • 举报
回复
CRect rc(0,0,400,300);
m_Dlg.MoveWindow(&rc);
homeyang 2004-06-21
  • 打赏
  • 举报
回复
也就是我想单一创建一个对话框,但是我不想手动去调窗口的大小,我想在运行的时候由程序去自动调整窗口的大小!这样也会比较精确!
tgb 2004-06-21
  • 打赏
  • 举报
回复
MoveWindow()


CDiaLog dlg;
dlg.create(IDD_DIALOG1);//原先假设对话框大小100×200
dlg.MoveWindow(CRect(0,0,400,400));//现在把对话框移动到屏幕0,0开始的大小为400×400的区域
dlg.ShowWIndow(SW_SHOW);

15,979

社区成员

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

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