天道酬勤,学无止境

toolstripcontrolhost

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

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 desire to show a panel, which contains a few custom items, and the panel's name is "pnlDateRangePicker". IT

2021-08-11 16:14:13    分类:问答    vb.net   popup   toolstripcontrolhost

.NET Multiple ToolStripButtons in a single ContextMenuItem

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?

2021-05-06 15:34:24    分类:问答    .net   contextmenu   toolstrip   toolstripbutton   toolstripcontrolhost