什麼檢查的形式變化的事件:
一個簡單的測試形式由(X)「最小化」點擊,並使用重新啓動任務管理器:
Load Form:
635291025619140000: Got Form1_Resize()
635291025619950000: Got Form1_Resize()
635291025620060000: Got Form1_Resize()
635291025620300000: Got Form1_Resize()
635291025620470000: Got Form1_Activated()
635291025620880000: Got Form1_GotFocus()
Click on (X) to minimize:
635291026059340000: Got Form1_Resize()
635291026059780000: Got Form1_Deactivate()
635291026059950000: Got Form1_LostFocus()
TaskManager SwitchTo:
635291026483820000: Got Form1_Resize()
635291026483910000: Got Form1_Activated()
635291026484010000: Got Form1_GotFocus()
Press Win-Symbol of Form (shows Start screen):
635291026724060000: Got Form1_Deactivate()
635291026724960000: Got Form1_LostFocus()
Click (X) in Start screen:
635291027163520000: Got Form1_Resize()
635291027163610000: Got Form1_Activated()
635291027163710000: Got Form1_GotFocus()
Click (X) of Form:
635291027673050000: Got Form1_Resize()
635291027673470000: Got Form1_Deactivate()
635291027673660000: Got Form1_LostFocus()
Re-Launched externally:
635291028243720000: Got Form1_Resize()
635291028243900000: Got Form1_Activated()
635291028244010000: Got Form1_GotFocus()
你看你總是得到取消激活+ LostFocus或激活+ GotFocus。你可以使用Deactivated + LostFocus捕捉窗體將被最小化/隱藏。 這是你在找什麼?
我編輯了你的標題。請參閱:「[應該在其標題中包含」標籤「](http://meta.stackexchange.com/questions/19190/)」,其中的共識是「不,他們不應該」。 –
此頁面列出的代碼允許您鉤住控件的窗口過程,也可以將它應用於窗體:http://mrpfister.com/programming/subclassing-net-compact-framework-controls/ – pasztorpisti