标题:有关改变窗体大小的问题
取消只看楼主
kim88511677
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2007-3-14
 问题点数:0 回复次数:1 
有关改变窗体大小的问题

void Cdlg::OnButton1()
{
// TOD Add your control notification handler code here
CString str;
if(GetDlgItemText(IDC_BUTTON1,str),str=="缩小")
{

SetDlgItemText(IDC_BUTTON1,"扩张");

}
else{

SetDlgItemText(IDC_BUTTON1,"缩小"); }
static CRect rectold;
static CRect rectnew;
CRect p;
GetWindowRect(&rectold);
GetDlgItem(IDC_PIC)->GetWindowRect(&p);
rectnew.top=rectold.top;
rectnew.left=rectold.left;
rectnew.right=rectold.right;
rectnew.bottom=p.bottom;


if(str=="缩小") { SetWindowPos(NULL,0,0,rectnew.Width(),rectnew.Height(),
SWP_NOMOVE|SWP_NOZORDER); }
else
SetWindowPos(NULL,0,0,rectold.Width(),rectold.Height(),
SWP_NOMOVE|SWP_NOZORDER);}

为什么按下缩小之后,再按就不扩大了那

搜索更多相关主题的帖子: 窗体 rectold IDC rectnew str 
2007-03-29 08:05
kim88511677
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2007-3-14
得分:0 

那请问怎么改啊

2007-03-29 20:35



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-127669-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.793303 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved