如何记录C#Form最小化前的坐标 通常c# form里面的最小化按钮点击的时候这个最小化触发的是什么事件?我想在form收缩之前记录一下form的位置,不知道该怎么记录??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 protected override void DefWndProc(ref Message m) { switch (m.Msg) { case WM_SIZE: if(m.WParam.ToInt32() == SIZE_MAXIMIZED) { // 窗体最大化 Console.WriteLine("Maxmized"); }else if(m.WParam.ToInt32() == SIZE_MINIMIZED) { // 窗体最小花 Console.WriteLine("Minimized"); }else { base.DefWndProc(ref m); } break; default: base.DefWndProc(ref m); break; } } private const int WM_SIZE = 0x0005; const int SIZE_MAXIMIZED = 2; const int SIZE_MINIMIZED = 1; private Point m_TempPoiont;private Point m_LastPoint;private void Form1_LocationChanged(object sender, EventArgs e){ if (this.Location.X == -32000 && this.Location.Y == -32000) { m_LastPoint = m_TempPoiont;//最小化了,m_LastPoint就是最小化前的位置。 } else { m_TempPoiont = this.Location; }} 窗体标题不响应MouseLeave,MouseEnter怎么办?? 删除节点 winform中打开窗口的问题 急!!求教诸位一个关于winform里的datagridview里选取多项数据作为查询条件的问题 图片定时转换功能如何实现?在线及等!!! 请教高人:如何让自定义Windows窗体控件在设计期按F1时可以打开自己的帮助文件! 首个字母大写的函数是什么? Webform中建树的问题 读文件有很多方式,有人能总结点啥吗? treeview控件使用中的问题(谢谢了) c# winform 动态代码添加控件(pictureBox) 求查询能功类似于金山词霸哪样,动态查询显示记录
switch (m.Msg) {
case WM_SIZE:
if(m.WParam.ToInt32() == SIZE_MAXIMIZED) {
// 窗体最大化
Console.WriteLine("Maxmized");
}else if(m.WParam.ToInt32() == SIZE_MINIMIZED) {
// 窗体最小花
Console.WriteLine("Minimized");
}else {
base.DefWndProc(ref m);
}
break;
default:
base.DefWndProc(ref m);
break;
}
} private const int WM_SIZE = 0x0005;
const int SIZE_MAXIMIZED = 2;
const int SIZE_MINIMIZED = 1;
private Point m_LastPoint;private void Form1_LocationChanged(object sender, EventArgs e)
{
if (this.Location.X == -32000 && this.Location.Y == -32000)
{
m_LastPoint = m_TempPoiont;//最小化了,m_LastPoint就是最小化前的位置。
}
else
{
m_TempPoiont = this.Location;
}
}