private void Form1_Resize(object sender, System.EventArgs e)
{
if(this.WindowState==FormWindowState.Minimized)
MessageBox.Show("最小化");
}
{
if(this.WindowState==FormWindowState.Minimized)
MessageBox.Show("最小化");
}
解决方案 »
- 反編譯dll, 修改之后rebuild, 叫我加reference, 加不加都報錯! >_<
- 新手问题 .........
- 一个超级简单初学者的问题?????
- Button触发show一个窗体?
- typed dataset选取某些记录
- 求教,自己写的非托管dll,在c++里调用函数成功了,在c#里却提示找不到入口点。
- C#获得键盘输入
- 写了一个JS图片转换..但是运行有问题
- 如何将几个Dll程序集,合并成一个???.dll程序集合。
- 请教GetType的用法:为何Type t1=Type.GetType("ClassLibrary1.Class1");不能执行?
- 高分求解:如何在IE中显示EXCEL的做的报表?本地计算机没安装EXCEL
- media player问题
(From)sender
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case 0x0008;//这个消息只是例子,具体哪个我也不晓得
MessageBox.Show("即将最小化");
break;
}
base.WndProc(ref m); }
The WM_SIZE message is sent to a window after its size has changed. WM_SIZE
fwSizeType = wParam; // resizing flag
nWidth = LOWORD(lParam); // width of client area
nHeight = HIWORD(lParam); // height of client area
Parameters
fwSizeType
Value of wParam. Specifies the type of resizing requested. This parameter can be one of the following values: Value Meaning
SIZE_MAXHIDE Message is sent to all pop-up windows when some other window is maximized.
SIZE_MAXIMIZED The window has been maximized.
SIZE_MAXSHOW Message is sent to all pop-up windows when some other window has been restored to its former size.
SIZE_MINIMIZED The window has been minimized.
SIZE_RESTORED The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies.
nWidth
Value of the low-order word of lParam. Specifies the new width of the client area.
nHeight
Value of the high-order word of lParam. Specifies the new height of the client area.
Return Values
If an application processes this message, it should return zero
其中的SIZE_MINIMIZED就是你要的