Class PopupControlContainer
A panel-derived class that will let you design custom popups within a form's designer.
Inheritance
Implements
Namespace: Syncfusion.Windows.Forms
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class PopupControlContainer : Panel, IPopupControlContainer, IPopupChild, INeedKeyboardMessages, INeedMouseMoveMessages, IMouseHookHLProcClient, IKeyboardProcHookClient, IPopupParent, IPopupItem
Remarks
To design a custom popup, drag-and-drop it off the toolbox into a form during design-time. Then populate it with appropriate controls just like you would any other panel. You can mark it as invisible (Visible = false) so that it will not interfere with the form's layout mechanism. It's also recommended that you unparent it from the design-time parent in your form constructor code, as shown in the sample code below.
When you are ready to popup, call this class's ShowPopup(Point) method. This will show the popup at the specified location.
There are different configurations in which you can use this PopupControlContainer.
- When you specify a Parent Control using ParentControl and pass a Point.Empty location to ShowPopup(Point), the popup location will be dynamically determined based on the ParentControl's bounds and the screen area.
When the popup is showing, the PopupControlContainer, in the ProcessDialogKey override will look for Alt, Enter, Tab, Esc, F4, and F2 keys and either cancel or close the popup. If you want to prevent this, then set IgnoreDialogKey to False. You should then make sure to close the popup manually whenever appropriate using HidePopup(PopupCloseType).
The PopupControlContainer also fires the BeforePopup, Popup(after popup) and CloseUp events that you can handle. You could for example set the focus on a control within the PopupControlContainer in the popup event handler.
Examples
The following example has a PopupControlContainer that gets shown when the user does an Alt+DownArrow on a text box.
public Form1()
{
InitializeComponent();
// It's recommended that you keep the PopupControlContainer unparented by
// any control on the form (which will be the default case as set up during design-time).
// Otherwise, the Form won't close sometimes after dropping down this popup!
this.popupControlContainer1.Parent.Controls.Remove(this.popupControlContainer1);
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.popupControlContainer1 = new Syncfusion.Windows.Forms.PopupControlContainer();
this.cancel = new System.Windows.Forms.Button();
this.OK = new System.Windows.Forms.Button();
this.popupTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.sourceTextBox = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.dropDownBtn = new System.Windows.Forms.Button();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.popupControlContainer1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// popupControlContainer1
//
this.popupControlContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.popupControlContainer1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.cancel,
this.OK,
this.popupTextBox});
this.popupControlContainer1.Location = new System.Drawing.Point(80, 128);
this.popupControlContainer1.Name = "popupControlContainer1";
this.popupControlContainer1.Size = new System.Drawing.Size(120, 128);
this.popupControlContainer1.TabIndex = 0;
this.popupControlContainer1.Visible = false;
this.popupControlContainer1.Popup += new System.EventHandler(this.popupControlContainer1_Popup);
this.popupControlContainer1.CloseUp += new Syncfusion.Windows.Forms.PopupClosedEventHandler(this.popupControlContainer1_CloseUp);
this.popupControlContainer1.BeforePopup += new System.ComponentModel.CancelEventHandler(this.popupControlContainer1_BeforePopup);
//
// cancel
//
this.cancel.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.cancel.Location = new System.Drawing.Point(64, 96);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(48, 24);
this.cancel.TabIndex = 2;
this.cancel.Text = "Cancel";
this.cancel.Click += new System.EventHandler(this.cancelButton_Click);
//
// OK
//
this.OK.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.OK.Location = new System.Drawing.Point(8, 96);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(48, 24);
this.OK.TabIndex = 1;
this.OK.Text = "OK";
this.OK.Click += new System.EventHandler(this.OK_Click);
//
// popupTextBox
//
this.popupTextBox.Multiline = true;
this.popupTextBox.Name = "popupTextBox";
this.popupTextBox.Size = new System.Drawing.Size(118, 90);
this.popupTextBox.TabIndex = 0;
this.popupTextBox.Text = "";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label1.Location = new System.Drawing.Point(16, 56);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(256, 64);
this.label1.TabIndex = 1;
this.label1.Text = "Associate a PopupControlContainer with this TextBox. And also transfer data back " +
"and forth between the popup and the TextBox.";
//
// sourceTextBox
//
this.sourceTextBox.Location = new System.Drawing.Point(40, 128);
this.sourceTextBox.Name = "sourceTextBox";
this.sourceTextBox.Size = new System.Drawing.Size(200, 20);
this.sourceTextBox.TabIndex = 2;
this.sourceTextBox.Text = "Alt+DownArrow for popup";
this.sourceTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxPopupParent_KeyDown);
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.dropDownBtn});
this.groupBox1.Location = new System.Drawing.Point(8, 32);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(280, 128);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "PopupControlContainer demo";
//
// dropDownBtn
//
this.dropDownBtn.Image = ((System.Drawing.Bitmap)(resources.GetObject("dropDownBtn.Image")));
this.dropDownBtn.Location = new System.Drawing.Point(240, 96);
this.dropDownBtn.Name = "dropDownBtn";
this.dropDownBtn.Size = new System.Drawing.Size(26, 20);
this.dropDownBtn.TabIndex = 0;
this.dropDownBtn.Click += new System.EventHandler(this.dropDownBtn_Click);
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2});
this.menuItem1.Text = "Help";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "About Syncfusion";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.sourceTextBox,
this.label1,
this.popupControlContainer1,
this.groupBox1});
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Menu = this.mainMenu1;
this.Name = "Form1";
this.Text = "Custom Popups Dialog";
this.popupControlContainer1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
[STAThread]
public static void Main()
{
Application.Run(new Form1());
}
#region OpenClosePopup
private void textBoxPopupParent_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
// Using this unconventional if statement syntax to avoid "and" symbol (documentation restriction, please ignore).
// If user pressed key down, then show the popup.
if(e.Alt)
if(e.KeyCode == Keys.Down)
if(!this.popupControlContainer1.IsShowing())
{
// Let the popup align around the source textBox.
this.popupControlContainer1.ParentControl = this.sourceTextBox;
// Passing Point.Empty will align it automatically around the above ParentControl.
this.popupControlContainer1.ShowPopup(Point.Empty);
e.Handled = true;
}
// Escape should close the popup.
if(e.KeyCode == Keys.Escape)
if(this.popupControlContainer1.IsShowing())
this.popupControlContainer1.HidePopup(PopupCloseType.Canceled);
}
private void OK_Click(object sender, System.EventArgs e)
{
this.popupControlContainer1.HidePopup(PopupCloseType.Done);
}
private void cancelButton_Click(object sender, System.EventArgs e)
{
this.popupControlContainer1.HidePopup(PopupCloseType.Canceled);
}
#endregion OpenClosePopup
#region PopupEvents
private void popupControlContainer1_BeforePopup(object sender, System.ComponentModel.CancelEventArgs e)
{
// Set the text to be edited with the text in the form text box.
this.popupTextBox.Text = this.sourceTextBox.Text;
}
private void popupControlContainer1_Popup(object sender, System.EventArgs e)
{
// Set the focus on the text box inside the popup after it is open.
this.popupTextBox.Focus();
this.popupTextBox.SelectionStart = 0;
this.popupTextBox.SelectionLength = 0;
}
private void popupControlContainer1_CloseUp(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs args)
{
// Transfer data from the popup.
if(args.PopupCloseType == PopupCloseType.Done)
{
this.sourceTextBox.Text = this.popupTextBox.Text;
}
// Set focus back to textbox.
if(args.PopupCloseType == PopupCloseType.Done
|| args.PopupCloseType == PopupCloseType.Canceled)
this.sourceTextBox.Focus();
}
#endregion PopupEvents
Constructors
PopupControlContainer()
Creates a new instance of the PopupControlContainer.
Declaration
public PopupControlContainer()
PopupControlContainer(IContainer)
Initializes a new instance of the PopupControlContainer class with a specified container.
Declaration
public PopupControlContainer(IContainer container)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.IContainer | container | A System.ComponentModel.IContainer that represents the container of the PopupControlContainer. |
Remarks
Containers are objects that encapsulate and track zero or more components. In this context, containment refers to logical containment, not visual containment. You can use components and containers in a variety of scenarios, including scenarios that are both visual and not visual.
Unlike other controls, a PopupControlContainer is not a direct child of your form (though this is the case during design-time). This requires you to explicitly dispose of this control before the form gets destroyed. With this constructor override, the PopupControlContainer automatically plugs itself into a form's default component-containment pattern (through the IContainer member) during design-time. If you create this class in code, then you have to set it up manually.
The implementation simply adds the PopupControlContainer instance into the container.
Properties
CloseOnTab
Specifies whether the drop down need to be closed on pressing tab on the last item and shift tab on the first item in the drop down.
Declaration
public bool CloseOnTab { get; set; }
Property Value
Type |
---|
System.Boolean |
CurrentPopupChild
Gets or sets the current popup child in the popup hierarchy.
Declaration
public IPopupChild CurrentPopupChild { get; set; }
Property Value
Type | Description |
---|---|
IPopupChild | An instance of IPopupChild interface. |
Remarks
When you want to show a parent-child hierarchy of popups, call this property on the parent popup before showing the child popup.
Examples
// While the parent PopupControlContainer is showing, you might want to show another child
// PopupControlContainer. You can do so as follows:
// Set up parent-child relationship.
parentPopupControlContainer.CurrentPopupChild = childPopupControlContainer;
childPopupControlContainer.PopupParent = parentPopupControlContainer;
// Now show the child popup.
childPopupControlContainer.ShowPopup();
DefaultMargin
Declaration
protected override Padding DefaultMargin { get; }
Property Value
Type |
---|
System.Windows.Forms.Padding |
DefaultSize
Declaration
protected override Size DefaultSize { get; }
Property Value
Type |
---|
System.Drawing.Size |
DesignMode
Indicates whether the control is in design-mode.
Declaration
public bool DesignMode { get; }
Property Value
Type |
---|
System.Boolean |
DiscreetLocation
Gets or sets the discreet location.
Declaration
public Point DiscreetLocation { get; set; }
Property Value
Type |
---|
System.Drawing.Point |
EnableTouchMode
gets or sets the touchmode
Declaration
public bool EnableTouchMode { get; set; }
Property Value
Type |
---|
System.Boolean |
FakeFocus
Indicates whether the popup should send a kill focus message to the control with focus when the popup was shown.
Declaration
public bool FakeFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to send a KillFocus message; False otherwise. Default value is False. |
Remarks
Faking focus is only necessary when the PopupControlContainer doesn't take the focus but you want it to look like it took the focus.
When this property is True, a KillFocus message will be sent to the control that currently has the focus after the PopupControlContainer is dropped down and a SetFocus message will be sent to the control with focus when the popup is closed.
Again, you will probably not need this functionality in most of the cases, since you will probably set the focus on some control with this PopupControlContainer as soon as it pops up (from within the popup event handler).
Font
Gets or sets the System.Drawing.Font value for the control.
Declaration
public override Font Font { get; set; }
Property Value
Type |
---|
System.Drawing.Font |
IgnoreDialogKey
Indicates whether to ignore dialog keys.
Declaration
public bool IgnoreDialogKey { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to ignore dialog keys; False if not to. Default is False. |
Remarks
When the popup is showing, the PopupControlContainer in the ProcessDialogKey override will look for Alt, Enter, Tab, Esc, F4, and F2 keys and either cancel or close the popup. If you want to prevent this, set IgnoreDialogKey = False. You should then listen for the above keys and make sure to close the popup manually whenever appropriate using HidePopup.
IgnoreKeys
Indicates whether to ignore all keys.
Declaration
public bool IgnoreKeys { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to ignore all keys; False otherwise. Default is False. |
Remarks
When the popup is showing, it will "swallow" all the WM_KEYDOWN and WM_CHAR messages. To prevent it, set this property to True.
IgnoreMouseMessages
Indicates whether to ignore all mouse messages.
Declaration
public bool IgnoreMouseMessages { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to ignore all mouse messages; False otherwise. Default is False. |
Remarks
When the popup is showing it will "swallow" all the mouse messages that are sent to controls not in the popup-hierarchy. When showing, the popup will also listen to mouse messages to determine if the popup should be closed (for mouse down outside the popup-hierarchy, for example).
To prevent this behavior, set this property to True.
When set to True, the popup will close only when you call the HidePopup(PopupCloseType) method or when a new popup gets shown.
ParentControl
Specifies the PopupControlContainer's control parent.
Declaration
public Control ParentControl { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.Control | A control instance. |
Remarks
The Parent-Child relationship in this case is NOT similar to the one in the control hierarchy.
When you specify a Parent Control via ParentControl and pass a Point.Empty location to ShowPopup, the popup location will be dynamically determined based on the ParentControl bounds and the screen area.
PopupHost
Gets or sets a reference to the PopupHost that will be used to host this PopupControlContainer when dropped down.
Declaration
public PopupHost PopupHost { get; set; }
Property Value
Type | Description |
---|---|
PopupHost | The PopupHost object that will host this PopupControlContainer. |
Remarks
PopupHost is the top level form-based control that hosts this PopupControlContainer when dropped down.
The PopupControlContainer usually creates a custom PopupHost when it is asked to drop down. However, you can provide your own PopupHost if you have a customized version.
You can also get a reference to the PopupHost that the PopupControlContainer uses by default and make changes to it. The PopupControlContainer creates a default PopupHost when there is no PopupHost supplied to it, but ShowPopup(Point) gets called to show the popup. Hence, the best place to get the default PopupHost associated with this PopupControlContainer is in the BeforePopup handler. Or call EnsurePopupHost() to create the default PopupHost if it is not yet created.
Examples
The following example shows how to make the PopupHost's border style resizable to create a resizable popup.
// The PopupControlContainer's BeforePopup event handler
private void popupControlContainer1_BeforePopup(object sender, System.ComponentModel.CancelEventArgs e)
{
// Create a Popup, that can be resized.
// Make the popup host's border style resizable.
this.popupControlContainer1.PopupHost.FormBorderStyle = FormBorderStyle.SizableToolWindow;
this.popupControlContainer1.PopupHost.BackColor = this.BackColor;
// Necessary to set the host's client size every time, especially since the
// popup's Dock style is set to DockStyle.Fill.
if(!(this.popupControlContainer1.PopupHost.Size.Width >= 140))
this.popupControlContainer1.PopupHost.Size = new System.Drawing.Size(140, 150);
// So that the popup container will fill the entire popup host when resized.
this.popupControlContainer1.Dock = DockStyle.Fill;
}</code></pre>
PopupParent
Specifies the IPopupParent parent.
Declaration
public IPopupParent PopupParent { get; set; }
Property Value
Type | Description |
---|---|
IPopupParent | An instance that implements IPopupParent. |
Remarks
When you associate an IPopupParent interface with the PopupControlContainer you get even more control over the alignment and positioning of the Popup, (this you would do instead of the PopupControl based parenting).
When you provide this interface, the alignment and positioning logic is delegated to this interface.
Methods
ApplyScaleToControl(Single)
applies the scaling
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scaleFactor |
ChildClosing(IPopupChild, PopupCloseType)
Declaration
protected virtual void ChildClosing(IPopupChild childUI, PopupCloseType popupCloseType)
Parameters
Type | Name | Description |
---|---|---|
IPopupChild | childUI | |
PopupCloseType | popupCloseType |
ConfirmDeactivate()
This method is called from the BarManager class when the parent form is deactivated. It checks whether the user clicked inside a child control of this PopupControlContainer. If this is not the case (e.g. user clicked on another window on the desktop) then the popup gets hidden.
Declaration
public virtual void ConfirmDeactivate()
CreateAccessibilityInstance()
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Type |
---|
System.Windows.Forms.AccessibleObject |
CreatePopupHost()
Declaration
protected virtual PopupHost CreatePopupHost()
Returns
Type |
---|
PopupHost |
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
EnsurePopupHost()
Ensures that the PopupHost property returns a valid PopupHost.
Declaration
public void EnsurePopupHost()
Remarks
Normally the PopupHost property will return a non-NULL value only when the popup was displayed at least once. Calling this method will ensure that the property returns a non-NULL value.
FocusFirstVisibleParent()
Focuses first visible parent.
Declaration
public virtual void FocusFirstVisibleParent()
FocusParent()
Sets focus on the popup parent control.
Declaration
public virtual void FocusParent()
GetBorderOverlapCue(PopupRelativeAlignment)
Declaration
protected virtual Point[] GetBorderOverlapCue(PopupRelativeAlignment relativeAlignment)
Parameters
Type | Name | Description |
---|---|---|
PopupRelativeAlignment | relativeAlignment |
Returns
Type |
---|
System.Drawing.Point[] |
GetLocationForPopupAlignment(PopupRelativeAlignment, out PopupRelativeAlignment)
Declaration
protected virtual Point GetLocationForPopupAlignment(PopupRelativeAlignment prevAlignment, out PopupRelativeAlignment newAlignment)
Parameters
Type | Name | Description |
---|---|---|
PopupRelativeAlignment | prevAlignment | |
PopupRelativeAlignment | newAlignment |
Returns
Type |
---|
System.Drawing.Point |
GetPreferredLocation(PopupRelativeAlignment, out PopupRelativeAlignment)
Gets preferred location.
Declaration
public virtual Point GetPreferredLocation(PopupRelativeAlignment prevAlignment, out PopupRelativeAlignment newAlignment)
Parameters
Type | Name | Description |
---|---|---|
PopupRelativeAlignment | prevAlignment | |
PopupRelativeAlignment | newAlignment |
Returns
Type |
---|
System.Drawing.Point |
HidePopup()
Hides a popup that is open.
Declaration
public virtual void HidePopup()
Remarks
This method will hide the popup with the Canceled mode.
HidePopup(PopupCloseType)
Hides a popup with the specified PopupCloseType mode.
Declaration
public virtual void HidePopup(PopupCloseType popupCloseType)
Parameters
Type | Name | Description |
---|---|---|
PopupCloseType | popupCloseType | A PopupCloseType value. |
IsInSetFocus()
Specifies whether the control is in set focus.
Declaration
public bool IsInSetFocus()
Returns
Type |
---|
System.Boolean |
IsRelatedControl(Control, Boolean)
Checks whether the control is a related control.
Declaration
public virtual bool IsRelatedControl(Control control, bool askPopupParent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | control | |
System.Boolean | askPopupParent |
Returns
Type |
---|
System.Boolean |
IsShowing()
Indicates whether the popup is currently dropped down.
Declaration
public bool IsShowing()
Returns
Type | Description |
---|---|
System.Boolean | True indicates popup is dropped down; False otherwise. |
OnBeforePopup(CancelEventArgs)
Raises the BeforePopup event.
Declaration
protected virtual void OnBeforePopup(CancelEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CancelEventArgs | args | A CancelEventArgs that contains the event data. |
Remarks
The OnBeforePopup method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnBeforePopup in a derived class, be sure to call the base class's OnBeforePopup method so that registered delegates receive the event.
OnCloseUp(PopupClosedEventArgs)
Raises the CloseUp event.
Declaration
protected virtual void OnCloseUp(PopupClosedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
PopupClosedEventArgs | args | A PopupClosedEventArgs instance containing data pertaining to this event. |
Remarks
The OnCloseUp method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnCloseUp in a derived class, be sure to call the base class's OnCloseUp method so that registered delegates receive the event.
OnFontChanged(EventArgs)
font changed
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnPopup(EventArgs)
Raises the Popup event.
Declaration
protected virtual void OnPopup(EventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | args | An EventArgs instance containing data pertaining to this event. |
Remarks
The OnPopup method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnPopup in a derived class, be sure to call the base class's OnPopup method so that registered delegates receive the event.
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
ProcessDialogKey(Keys)
Overridden. See System.Windows.Forms.Control.ProcessDialogKey.
Declaration
protected override bool ProcessDialogKey(Keys key)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Keys | key |
Returns
Type |
---|
System.Boolean |
ProcessMouseMessage(Control, Int32, IntPtr, IntPtr)
Declaration
protected virtual bool ProcessMouseMessage(Control destination, int msg, IntPtr lParam, IntPtr wParam)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | destination | |
System.Int32 | msg | |
System.IntPtr | lParam | |
System.IntPtr | wParam |
Returns
Type |
---|
System.Boolean |
ShowPopup(Point)
Declaration
public virtual void ShowPopup(Point location)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | location |
VeryifyMouseBasedDeactivation(Control, Int32)
Declaration
protected virtual void VeryifyMouseBasedDeactivation(Control destinationControl, int msg)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | destinationControl | |
System.Int32 | msg |
WndProc(ref Message)
Overridden. System.Windows.Forms.Control.WndProc.
Declaration
protected override void WndProc(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m |
Events
BeforeCloseUp
Occurs before a popup is closed.
Declaration
public event CancelEventHandler BeforeCloseUp
Event Type
Type |
---|
System.ComponentModel.CancelEventHandler |
BeforePopup
Occurs when the popup is about to be shown.
Declaration
public event CancelEventHandler BeforePopup
Event Type
Type |
---|
System.ComponentModel.CancelEventHandler |
Remarks
You may choose to cancel drop-down in this handler. This is also a good place, for example, to access the PopupControlContainer's PopupHost and make changes to it.
CloseUp
Occurs when a popup is closed.
Declaration
public event PopupClosedEventHandler CloseUp
Event Type
Type |
---|
PopupClosedEventHandler |
Remarks
Handling this event will tell you whether the popup was closed or canceled by the user. This, in some cases, will then let you know whether or not you should accept changes in the popup.
Popup
Occurs after the popup has been dropped down and made visible.
Declaration
public event EventHandler Popup
Event Type
Type |
---|
System.EventHandler |
Remarks
This is a good place, for example, to set the focus on a control in the popup.
Explicit Interface Implementations
IKeyboardProcHookClient.KeyboardHookProc(Int32, Int32)
Declaration
bool IKeyboardProcHookClient.KeyboardHookProc(int wParam, int lParam)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | wParam | |
System.Int32 | lParam |
Returns
Type |
---|
System.Boolean |
IMouseHookHLProcClient.MouseHookProc(Int32, Point, IntPtr, Int32, Int32)
Declaration
bool IMouseHookHLProcClient.MouseHookProc(int msg, Point point, IntPtr hwnd, int wHitTestCode, int dwExtraInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | msg | |
System.Drawing.Point | point | |
System.IntPtr | hwnd | |
System.Int32 | wHitTestCode | |
System.Int32 | dwExtraInfo |
Returns
Type |
---|
System.Boolean |
INeedKeyboardMessages.KeyboardMessage(ref Message)
Declaration
bool INeedKeyboardMessages.KeyboardMessage(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m |
Returns
Type |
---|
System.Boolean |
INeedMouseMoveMessages.MouseMessage(ref Message)
Declaration
bool INeedMouseMoveMessages.MouseMessage(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m |
Returns
Type |
---|
System.Boolean |
IPopupItem.GetPopupParentControl()
Declaration
Control IPopupItem.GetPopupParentControl()
Returns
Type |
---|
System.Windows.Forms.Control |
IPopupParent.ChildClosing(IPopupChild, PopupCloseType)
Declaration
void IPopupParent.ChildClosing(IPopupChild childUI, PopupCloseType popupCloseType)
Parameters
Type | Name | Description |
---|---|---|
IPopupChild | childUI | |
PopupCloseType | popupCloseType |
IPopupParent.GetBorderOverlapCue(PopupRelativeAlignment)
Declaration
Point[] IPopupParent.GetBorderOverlapCue(PopupRelativeAlignment relativeAlignment)
Parameters
Type | Name | Description |
---|---|---|
PopupRelativeAlignment | relativeAlignment |
Returns
Type |
---|
System.Drawing.Point[] |
IPopupParent.GetLocationForPopupAlignment(PopupRelativeAlignment, out PopupRelativeAlignment)
Declaration
Point IPopupParent.GetLocationForPopupAlignment(PopupRelativeAlignment prevAlignment, out PopupRelativeAlignment newAlignment)
Parameters
Type | Name | Description |
---|---|---|
PopupRelativeAlignment | prevAlignment | |
PopupRelativeAlignment | newAlignment |
Returns
Type |
---|
System.Drawing.Point |
IPopupParent.IsRightToLeft
Declaration
bool IPopupParent.IsRightToLeft { get; }
Returns
Type |
---|
System.Boolean |