[]
A class to assist in creating popup windows like combo box drop-downs and menus. This class includes functionality to keep the title bar of the popup owner form active while the popup is displayed, and to automatically cancel the popup whenever the user clicks outside the popup window or shifts focus to another application.
public class PopupWindowHelper : NativeWindow, IWin32Window
Public Class PopupWindowHelper
Inherits NativeWindow
Implements IWin32Window
Name | Description |
---|---|
PopupWindowHelper(Control) | Default constructor. |
Name | Description |
---|---|
ClosePopup() | Called when the popup is being hidden. |
OnPopupCancel(PopupCancelEventArgs) | Raises the PopupCancel event. |
OnPopupClosed(PopupClosedEventArgs) | Raises the PopupClosed event. |
ShowPopup(Control, Form, Point) | Shows the specified Form as a popup window, keeping the Owner's title bar active and preparing to cancel the popup should the user click anywhere outside the popup window. Typical code to use this message is as follows:
Put as much initialization code as possible into the popup form's constructor, rather than the Load event as this will improve the visual appearance. |
WndProc(ref Message) | Subclasses the owning form's existing Window Procedure to enables the title bar to remain active when a popup is show, and to detect if the user clicks onto another application whilst the popup is visible. |
Name | Description |
---|---|
PopupCancel | Raised when the Popup Window is about to be cancelled. The
Cancel property can be
set to |
PopupClosed | Raised when the popup form is closed. |