Questions tagged [toolstripcontrolhost]

25 questions
1
vote
1 answer

.NET ToolStrip control bug: leave event not fired until the ToolStrip is disposed

To reproduce this bug you need to create custom ToolStripItem, using ToolStripControlHost. In my case, I made ToolStripDateTimePicker control (as seen on many good tutorials). The control however behaves slightly different than a regular…
Harry
  • 4,524
  • 4
  • 42
  • 81
1
vote
0 answers

ToolstripControlHost causes toolstrip to not disappear when the program execution is paused

I am trying to build a custom WinForms ToolStripDropDownMenu. I need custom menu items so I am using ToolStripControlHosts. The problem is that when the menu is open and I hit a breakpoint the menu does not disappear and stays on top of all…
Tamas Pataky
  • 353
  • 4
  • 16
1
vote
1 answer

How to keep focus on a ToolStripControlHost's Owner in a ToolStrip

Using C# with .Net 2.0 (though the problem occurs in 4.0) There appears to be a bug involving the focus of the ToolStrip control and ToolStripControlHosts in Windows Forms. Consider this example: The user clicks on ToolStripMenuItem "Test A", then…
0
votes
2 answers

DateTimePicker control in ContextMenuStrip

I have added a DateTimePicker in ContextMenuStrip using ToolStripControlHost. I am using below code. DateTimePicker startDate = new DateTimePicker(); (cms.Items["mnuStartDate"] as ToolStripMenuItem).DropDownItems.Add(new…
Zhyke
  • 427
  • 7
  • 22
0
votes
0 answers

ListViewGroups vanish when used in WinForms ToolStripControlHost

Windows 10, VS 2019 Community, VB.Net... I'm wanting to use a listview control as a custom menu. Created a usercontrol, added a listview and populated it with groups and items in each group. I then added it to a ToolStripControlHost, and this was in…
0
votes
1 answer

Howto size a control in a ToolStripControlHost-item?

i have litte problem here. I just made a UserControl for Undo/Redo like in Visual Studio. I wanted to add it to my MenuStrip by an ToolStripControlHost. The problem is, that the control is too small. It´s width is just about 100, but should be…
SharpShade
  • 1,761
  • 2
  • 32
  • 45
0
votes
1 answer

Panel.Dispose closes context menu, why?

As per Cody's answer to this question, I derived a class from ContextMenuStrip and handle the ProcessCmdKey. This successfully prevents the menu from closing when pressing Enter while a textbox embedded inside the menu has focus. So all is well…
David Rutten
  • 4,716
  • 6
  • 43
  • 72
0
votes
2 answers

How to set the DataSource of a DataGridView inside a ToolStripControlHost? (C# window forms)

I have a DataGridView inside a ContextMenu control, please see the code snippet below: private void Form1_Load(object sender, EventArgs e) { SetDataSource(dataSet1);// A populated DataSet } protected void…
yonan2236
  • 13,371
  • 33
  • 95
  • 141
0
votes
1 answer

How to show custom control as a drop down window?

I want to show my custom control(eg: monthcalendar) as a drop-down (popup) window. One option is to use ToolStripDropDown and ToolStripControlHost as the second example in msdn example. My doubt is: ToolStripDropDown should be used for ToolStrip…
Kaizen
  • 219
  • 2
  • 17
0
votes
1 answer

How to access the event when a list of radio button is selected at a context menu strip?

I'm creating the radio buttons in the ContextMenuStrip using the ToolStripControlHost, this way RadioButton taskRb = new RadioButton(); taskRb.Text = DataGridTable.getTasks()[i].name.ToString(); taskRb.Checked = false; ToolStripControlHost tRb = new…
1
2