toolstrip

.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

ToolStrip memory leak

China☆狼群 提交于 2019-12-01 06:28:48
I've been having trouble with memory leaks with the SWF-ToolStrip. According to this http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=115600# is has been resolved. But here it seemes not. Anyone know how to resolve this? This problem seems to persist in .NET 3.5 SP1 as well as .NET 4.0. To reproduce the problem you must create a ToolStrip with more items than it can display which causes it to create an overflow button. The problem only appears when you actually click the overflow button. Clicking it causes a ToolStripOverflow object to be created which subscribes

ToolStrip memory leak

拥有回忆 提交于 2019-12-01 05:15:04
问题 I've been having trouble with memory leaks with the SWF-ToolStrip. According to this http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=115600# is has been resolved. But here it seemes not. Anyone know how to resolve this? 回答1: This problem seems to persist in .NET 3.5 SP1 as well as .NET 4.0. To reproduce the problem you must create a ToolStrip with more items than it can display which causes it to create an overflow button. The problem only appears when you

Trying to add a ToolStrip to a ToolStripPanel side-by-side with an existing ToolStrip

怎甘沉沦 提交于 2019-11-30 21:12:07
I'm using .net 2.0 with Visual Studio 2005 and I am trying to add two different toolstrips to the top of the form such that they show up side-by-side. I want it to be like Word 2003, where you can add multiple toolstrips to the same row and have them show up in line with each other, rather than dedicating a row to each toolstrip. So I added a ToolStripPanel and docked it to the top of the form (I didn't use a ToolStripContainer because I don't need all the extra panels; I just need the one at the top). I added both toolstrips and set their Stretch properties to False. I can get them to show up

How do I make cross-threaded calls to a ToolStripStatusLabel?

試著忘記壹切 提交于 2019-11-30 17:35:34
I tend to use a StatusStrip at the bottom of most of my applications for simple status updates and occasionally a progress bar. However, it appears ToolStripStatusLabels do not inherit from control, so they have no .Invoke, or .InvokeRequired. So how would I thread-safe make a call to change it's text property? Coded answers for posterity and others that come searching: Action<string> test=(text) => { if (this._statusStrip.InvokeRequired) this._statusStrip.Invoke( new MethodInvoker(() => this._lblStatus.Text = text)); else this._lblStatus.Text = text; }; or private void TestInvoker(string text

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

Trying to add a ToolStrip to a ToolStripPanel side-by-side with an existing ToolStrip

假装没事ソ 提交于 2019-11-30 05:32:24
问题 I'm using .net 2.0 with Visual Studio 2005 and I am trying to add two different toolstrips to the top of the form such that they show up side-by-side. I want it to be like Word 2003, where you can add multiple toolstrips to the same row and have them show up in line with each other, rather than dedicating a row to each toolstrip. So I added a ToolStripPanel and docked it to the top of the form (I didn't use a ToolStripContainer because I don't need all the extra panels; I just need the one at

How do I make cross-threaded calls to a ToolStripStatusLabel?

南楼画角 提交于 2019-11-30 01:31:58
问题 I tend to use a StatusStrip at the bottom of most of my applications for simple status updates and occasionally a progress bar. However, it appears ToolStripStatusLabels do not inherit from control, so they have no .Invoke, or .InvokeRequired. So how would I thread-safe make a call to change it's text property? Coded answers for posterity and others that come searching: Action<string> test=(text) => { if (this._statusStrip.InvokeRequired) this._statusStrip.Invoke( new MethodInvoker(() => this

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

How to disable the line under tool strip in winform c#?

旧街凉风 提交于 2019-11-29 22:38:06
this line ? sgoldyaev It's a bug in the "system" renderer, details in this bug report . Microsoft's response gives a very easy workaround: 1) Create a subclass of ToolStripSystemRenderer , overriding OnRenderToolStripBorder and making it a no-op: public class MySR : ToolStripSystemRenderer { public MySR() { } protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { //base.OnRenderToolStripBorder(e); } } 2) Use that renderer for your toolstrip: toolStrip3.Renderer = new MySR(); You might want to add type check to avoid missing border on ToolStripDropDownMenu /etc. (since