toolstripcontrolhost

.NET Multiple ToolStripButtons in a single ContextMenuItem

僤鯓⒐⒋嵵緔 提交于 2019-12-19 11:20:22
问题 I'm trying to create a ContextMenu where some items in the menu contain more than a single item. You could see it as trying to combine a ToolStrip and ContextMenuItem. I've tried using a ToolStripControlHost, but this creates problems with the focus. It basically requires you to click everything in the ToolStrip twice.. ContextMenuStrip m = new ContextMenuStrip(); ToolStrip tStrip = new ToolStrip(new ToolStripDropDownButton(), new ToolStripButton()); ToolStripControlHost tsHost = new

Padding/ Size / Margin, when using ToolstripControlHost for a popup control

亡梦爱人 提交于 2019-12-10 18:58:45
问题 I'm using VB2008 Express. And I've been working on a "popup" to select a date range. The DateTimePicker isn't ideal because the purpose is to pick a date range, which will always be one full week, from Sunday through Saturday. The control works just fine and I'm pretty proud of it. My problem has to do with the border added when using ToolstripControlHost for this. I've included a screenshot and my code. In the code below, assume there exists a button named "btnTimePeriod", below which I

.NET Multiple ToolStripButtons in a single ContextMenuItem

谁说我不能喝 提交于 2019-12-01 12:04:08
I'm trying to create a ContextMenu where some items in the menu contain more than a single item. You could see it as trying to combine a ToolStrip and ContextMenuItem. I've tried using a ToolStripControlHost, but this creates problems with the focus. It basically requires you to click everything in the ToolStrip twice.. ContextMenuStrip m = new ContextMenuStrip(); ToolStrip tStrip = new ToolStrip(new ToolStripDropDownButton(), new ToolStripButton()); ToolStripControlHost tsHost = new ToolStripControlHost(tStrip); m.Items.Add(tsHost); Any thoughts on how to achieve this? A ContextMenuStrip is