How do I detect if the user clicks into another window from a modal dialog?
Use the Form.Deactivate event: Deactivate += new EventHandle( OnDeactivate ); // … private void OnDeactivate( object s, EventArgs e ) { Close(); } Shawn Burke, Microsoft, # No product version has been specified for this FAQ item. Please report status updates here. • How do I get an HWND for a form or control? See the Control.Handle property which returns the HWND. Be careful if you pass this handle to some Win32 API as Windows Forms controls do their own handle management so they may recreate the handle which would leave this HWND dangling. Shawn Burke, Microsoft, # No product version has been specified for this FAQ item. Please report status updates here. • How do I prevent a form from being shown in the taskbar? You need to set the form’s ShowInTaskbar property to False to prevent it from being displayed in the Windows taskbar. Contributed from George Shepherd’s Windows Forms FAQ, # No product version has been specified for this FAQ item. Please report status updates here. • How do
Related Questions
- When I try to open the form, the computer says there is an open dialog window and to close it before continuing. What is this?
- When a user clicks a subfolder link in a folder portlet, the content area displays. How can I keep them on the portal page?
- How do I detect if the user clicks into another window from a modal dialog?