)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to update the control states in Parent Form based on key inputs in Floating Form of WinForms Docking Manager?

Platform: WinForms |
Control: DockingManager |
Published Date: May 30, 2016 |
Last Revised Date: December 4, 2019

Method and event

In DockingManager, it is possible to update the control states of the Parent Form based on Key inputs in Floating Form by handling the Floating Form event named KeyDown and function named PerformClick in MenuStrip.

 

The following code example demonstrates the same.

C#

/// <summary>
/// Occurs when a key is pressed while the control has focus.
/// </summary>
void control2_KeyDown(object sender, KeyEventArgs e)
{
    if (e.Control && e.KeyCode == Keys.S)       // Ctrl-S Save
    {
         e.SuppressKeyPress = true; 
         string activeControl = _dockingManager.GetDockLabel(_dockingManager.ActiveControl);
         this.asdasdToolStripMenuItem.PerformClick();
    }
}

 

VB

''' <summary>
''' Occurs when a key is pressed while the control has focus.
''' </summary>
Private Sub control2_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
 If e.Control AndAlso e.KeyCode = Keys.S Then ' Ctrl-S Save
    e.SuppressKeyPress = True
    Dim activeControl As String = _dockingManager.GetDockLabel(_dockingManager.ActiveControl)
    Me.asdasdToolStripMenuItem.PerformClick()
 End If
End Sub

 

Update control states of the parent form

Figure 1.  Update control states of the Parent Form based on Key inputs in Floating Form with image

Samples:

 

C#: How to update controls states in DockingManager Parent Form, based on Key inputs in Floating Form?

 

VB: How to update controls states in DockingManager Parent Form, based on Key inputs in Floating Form?

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon