toolstripdropdown

Debugger Visualizer Winform ToolStripDropDownMenu ComboBox only shows items when first shown

蓝咒 提交于 2020-05-31 03:27:11
问题 I have a Visual Studio debugger visualizer project, and when I add a ToolStripComboBox to a ToolStripDropDownMenu , the combobox's items only appear the first time the form is shown. Like this: The most basic version of the winform code showing the issue is this: public class MyVisualizerDialog : Form { public MyVisualizerDialog() { var toolStripComboBox = new ToolStripComboBox { Items = { "One", "Two", "Three" } }; var toolStripDownDown = new ToolStripDropDownMenu { Items = {

Converting ToolBar to ToolStrip control and MouseHover not working

*爱你&永不变心* 提交于 2020-01-25 10:06:25
问题 I have a large winform application which we working to modify the appearance. I am replacing System.Windows.Forms.Toolbar to System.Windows.Forms.ToolStrip control. I use a custom renderer to change dropdown arrow color. with default renderer i get mouse hover effects in toolstrip but with my custom rendering it dont seem to work. Here's my code. Tool strip initialization:I removed unnecessary code for reading comfort this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.imageList1 =

How to find toolstripmenuItem with name

十年热恋 提交于 2019-12-24 03:31:06
问题 I have set visible property of my menuStrip1 items to false as foreach (ToolStripMenuItem itm in menuStrip1.Items) { itm.Visible = false; } Now I know the Names of toolStripMenuItem and dropDownItem of the menustrip1. How to can I activate the required toolStripMenuItem and dropDownItem . I have string mnItm = "SalesToolStripMenuItem"; string ddItm = "invoiceToolStripMenuItem"; Now I want to set visible true to these two( toolStripMenuItem and dropDownItem ) items. How can I do that? I know

Windows Forms - ToolStripItem Visible property is always set to false

荒凉一梦 提交于 2019-12-23 07:55:36
问题 I'm working on a MDI Windows Forms application. My parent form has ToolStrip menu and some ToolStripDropDownButtons . I want to change the Visible property of the ToolStripDropDownButton or to some of the ToolStripItems (sub buttons) that it has accordingly to the permission of the user. Here is the part of the method that I've wrote to manage this: private void SetToolStripDropDownVisibility(ToolStripDropDownButton mainBtn, params ToolStripItem[] item) { mainBtn.Visible = false; foreach

How do I close a toolstripmenuitem that is set to autoclose = false?

主宰稳场 提交于 2019-12-12 04:55:25
问题 I have a menu of items that the user can toggle. I wanted the menu to stay open so the user can check all the items they want. I set autoclose = false and now that works great. However, I also cannot close the window now lol. I tried clicking off of the menu onto the form, hitting escape, hitting the menu item, hitting the keycombo for the menu, nothing works. Ideally, I'd like the user to be able to just click the form or basically anything but the menu to close it or press escape. How would

C#: ToolStripDropDown doesn't Dispose/DestroyHandle

风流意气都作罢 提交于 2019-12-12 04:29:04
问题 I'm using the ToolStripDropDown to show up an selectionpopup. The ToolStripDropDown contains a few custom controls with running Threads. The Threads ends with the OnHandleDestroyed event, but for some reason the ToolStripDropDown doesn't dispose/destroy it's handle after closing. Disposing the ToolStripDropDown on the closed-event gives me an exception because anything still accesses the ToolStripDropDown. How do I know if the custom Control is still in use or not to end the thread? Custom

ToolStripDropDownButton equivalent in WPF?

倖福魔咒の 提交于 2019-12-11 01:37:49
问题 I'm very newbie to the WPF technology. I've been developing in WinForms for around 6 years. Now I would like to advance one big step in my skills by learning WPF. I'm reading the introduction guides in MSDN, while as a personal exercise I'm trying to translate the sructure of a WinForms UI to its WPF UI equivalent. This is a simple mockup of the WinForms controls structure that I would like to reproduce in WPF: My problem is trying to reproduce the equivalent control/behavior for the

How to sort items in ToolStripItemCollection?

假如想象 提交于 2019-12-07 02:15:24
问题 I add strings (items) dynamically to a ToolStripItemCollection by: Dim onClickHandler As System.EventHandler = New System.EventHandler(AddressOf Symbol_Click) Dim item As New ToolStripMenuItem(newSymbol, Nothing, onClickHandler) SomeToolStripMenuItem.DropDownItems.Add(item) So the items are not added in one go, but one-by-one based on external triggers throughout the program session. I would like to sort the drop-down-list every time I add a new item. What are my options to achieve that? 回答1:

How to sort items in ToolStripItemCollection?

核能气质少年 提交于 2019-12-05 06:21:48
I add strings (items) dynamically to a ToolStripItemCollection by: Dim onClickHandler As System.EventHandler = New System.EventHandler(AddressOf Symbol_Click) Dim item As New ToolStripMenuItem(newSymbol, Nothing, onClickHandler) SomeToolStripMenuItem.DropDownItems.Add(item) So the items are not added in one go, but one-by-one based on external triggers throughout the program session. I would like to sort the drop-down-list every time I add a new item. What are my options to achieve that? SpeziFish Since ToolStripItemCollection has no "Sort"-Function, you have to listen on changes and write

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

…衆ロ難τιáo~ 提交于 2019-12-04 05:47:28
问题 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 回答1: To solve the problem put this code in the Load event of form: var item =