求C#简单的算法可是我不会求解啊 我是垃圾,太笨,不会啊我想实现:一个窗体上有一个按钮,我点击这个按钮,这个窗体尺寸会变大,我再次点击这个按钮时窗体又恢复原来大小反复我就这样点击变大变小,这个怎么弄啊?我不会,给个算法啊,同学 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 bool mouseDn = false; private void button1_Click(object sender, EventArgs e) { if (mouseDn == false) { this.Width = 500; this.Height = 500; mouseDn = true; } else { this.Width = 300; this.Height = 300; mouseDn = false; } } int myx,myy;myx=this.DesktopLocation.X;myy=this.DesktopLocation.Y;if(this.DesktopBounds.Height == 288){Rectangle tempRect = new Rectangle(myx,myy,280,488);this.DesktopBounds = tempRect;}else{Rectangle tempRect = new Rectangle(myx,myy,280,288);this.DesktopBounds = tempRect;} bool a = false; private void button1_Click(object sender, EventArgs e) { if (a == false) { this.Width = 300; this.Height = 200; a = true; } else { this.Width = 150; this.Height = 150; a = false; } } if (mouseDn == false)C#是这样判断boolean的吗?不能if(mouseDn){}吗? if (mouseDn == false)等价于if (!mouseDn) 如何对aspx页的非服务器控件赋值? 为什么无法退出,页面只是刷新了一下,为什么? 百分征集:写一个跨线程访问UI的方法。 帮帮我,怎么我用生成的xml文件没有回行,我用的是XmlDocument的Save方法存的 树型控件的数据绑定问题 在vs.net2005环境开发vss6.0应该如何配置?顶者有分 各位高手:有关数据库的‘关系’概念不清,请指教? 关于视图的显示 哪里有.net 的 VSS 下载? 40G的FTP,好东东无数,现试开.请大家测试..如果没问题的话长期开放 winform里面怎么发送get请求,求高手 求C#高手当我的老师
bool mouseDn = false;
private void button1_Click(object sender, EventArgs e)
{
if (mouseDn == false)
{
this.Width = 500;
this.Height = 500;
mouseDn = true;
}
else
{
this.Width = 300;
this.Height = 300;
mouseDn = false;
}
}
myx=this.DesktopLocation.X;
myy=this.DesktopLocation.Y;
if(this.DesktopBounds.Height == 288)
{
Rectangle tempRect = new Rectangle(myx,myy,280,488);
this.DesktopBounds = tempRect;
}
else
{
Rectangle tempRect = new Rectangle(myx,myy,280,288);
this.DesktopBounds = tempRect;
}
bool a = false;
private void button1_Click(object sender, EventArgs e)
{
if (a == false)
{
this.Width = 300;
this.Height = 200;
a = true;
}
else
{
this.Width = 150;
this.Height = 150;
a = false;
}
}
C#是这样判断boolean的吗?
不能if(mouseDn){}吗?
if (mouseDn == false)
等价于
if (!mouseDn)