三个长期坚持不动摇:卓为VC——界面/窗口——在对话框中使工具栏和状态栏大小随着窗口大小改变
来源:百度文库 编辑:偶看新闻 时间:2024/04/29 03:08:40
void CXXXDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect rectDlg;
CPaintDC dc(this);
GetClientRect(rectDlg);
CRect rectBar;
//工具栏
CToolBar *m_pwndToolBar = (CToolBar *)AfxGetApp()->m_pMainWnd->
GetDescendantWindoW(AFX_IDW_TOOLBAR);
m_pwndToolBar->GetClientRect(&rectBar);
//如果不加4,经过若干次最窗口改变大小,则工具栏被完全覆盖
m_pwndToolBar->MoveWindow(0,0,rectDlg.Width(),rectBar.Height()+4);
//状态栏
CStatusBar *m_pwndStatusBar = (CStatusBar *)AfxGetApp()->m_pMainWnd->
GetDescendantWindow(AFX_IDW_STATUS_BAR);
m_pwndStatusBar->GetClientRect(&rectBar);
m_pwndStatusBar->MoveWindow(0,cy-rectBar.Height(),rectDlg.Width(),rectBar.Height());
// 绘制对话框背景色
dc.FillSolidRect(rectDlg,RGB(255,255,255)); //设置为白色
}
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect rectDlg;
CPaintDC dc(this);
GetClientRect(rectDlg);
CRect rectBar;
//工具栏
CToolBar *m_pwndToolBar = (CToolBar *)AfxGetApp()->m_pMainWnd->
GetDescendantWindoW(AFX_IDW_TOOLBAR);
m_pwndToolBar->GetClientRect(&rectBar);
//如果不加4,经过若干次最窗口改变大小,则工具栏被完全覆盖
m_pwndToolBar->MoveWindow(0,0,rectDlg.Width(),rectBar.Height()+4);
//状态栏
CStatusBar *m_pwndStatusBar = (CStatusBar *)AfxGetApp()->m_pMainWnd->
GetDescendantWindow(AFX_IDW_STATUS_BAR);
m_pwndStatusBar->GetClientRect(&rectBar);
m_pwndStatusBar->MoveWindow(0,cy-rectBar.Height(),rectDlg.Width(),rectBar.Height());
// 绘制对话框背景色
dc.FillSolidRect(rectDlg,RGB(255,255,255)); //设置为白色
}
vc编程——对话框之间传值问题!
【类vc界面】获取一个(对话框)窗口句柄后,把它放入(sizebar)里出异常!!??
如何VC++6.0在窗口客户区中设置按钮,按下按钮弹出对话框?
如何让网络游戏界面为窗口化
vc在对话框中怎样绘制图形?
在vc中怎现将对话框跟数据库连接起来??
在VC++中模态对话框与非模态对话框的区别?
vc++ 在窗口中添加状态栏?
计算机术语——界面
我的电脑开机一切正常,也出现XP界面,但在“—”等待后,就出现黑屏,请求大虾指教!为谢!
vc中主界面如何调用登陆窗口??用什么函数什么语句?
用vc++进行api编程时怎样实现应用程序只打开对话框而不打开窗口
劲舞团如何把游戏界面调为窗口模式
VC 6.0如何在软件界面中显示web页面?
. 写出在VC环境下建立一个对话框的步骤??
vc 中如何在架API 中调用字体对话框
求救高手:怎样在VC++(MFC)的对话框中帖图?
在VC++中对话框变成的基本步骤是什么?
用VC实现在对话框上显示多张图片
求助:VC++ 在对话框调用时显示很多的文字
VC 界面编程求救
VC对话框的问题
VC 对话框资源
在VC++中,模态对话框和非模态对话框,在程序上有何区别?