Donate

Close ToolStripDropdown Object When Parent Container Or Form Is Clicked In C# Windows Forms

To close the ToolStripDropdown object which is part of the textbox custom control, add event handler signatures and event definition using the code below:
//add statements in the custom control constructor  
  this.Parent.Click += new EventHandler(Parent_Click);  
  this.Parent.Move += new EventHandler(Parent_Click);  

 //event body  
  private void Parent_Click(object sender, EventArgs e)  
 {  
      _dropDown.Close(); //ToolStripDropdown object  
  }  
Cheers!

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.