toolstripdropdown

ToolStripCombobox displays at the top left corner of the screen when DropDownStyle is Simple

僤鯓⒐⒋嵵緔 提交于 2019-12-02 10:40:24
I have a ToolStripCombobox that when I set its DropDownStyle to Simple . The first time which I open the menu, it displays at the top left corner of the screen. However, when I select the same item for the second time, it displays in the correct location. Is there a way to prevent the code from showing the list at the top left corner of the screen? Thank you in advance for any help. First Time Second Time To solve the problem put this code in the Load event of form: var item = toolStripComboBox1; var createControl = item.Control.Parent.GetType().GetMethod("CreateControl", System.Reflection

C# Winfoms Toolstripdropdown close on button click

假如想象 提交于 2019-11-30 15:27:17
I have used toolstripdropdown in my Windows form to show list of buttons on click of another button. var td = new ToolStripDropDown { AutoSize = true, DropShadowEnabled = false, BackColor = Color.Transparent, Margin = Padding.Empty, Padding = Padding.Empty }; var host = new ToolStripControlHost(panel) { BackColor = Color.Transparent, Margin = Padding.Empty, Padding = Padding.Empty }; td.Items.Add(host); The panel contains list of buttons to be displayed. To show the panel to user, on button(Show) click following line is called. td.Show(pointonScreen); By default, AutoClose is set to true. So

C# Winfoms Toolstripdropdown close on button click

有些话、适合烂在心里 提交于 2019-11-29 22:59:34
问题 I have used toolstripdropdown in my Windows form to show list of buttons on click of another button. var td = new ToolStripDropDown { AutoSize = true, DropShadowEnabled = false, BackColor = Color.Transparent, Margin = Padding.Empty, Padding = Padding.Empty }; var host = new ToolStripControlHost(panel) { BackColor = Color.Transparent, Margin = Padding.Empty, Padding = Padding.Empty }; td.Items.Add(host); The panel contains list of buttons to be displayed. To show the panel to user, on button