toolstripbutton

How do I programmatically wire up ToolStripButton events in C#?

Hi, this is my problem: I'm programmatically adding ToolStripButton items to a context menu. That part is easy. this.tsmiDelete.DropDownItems.Add("The text on the item."); However, I also need to wire up the events so that when the user clicks the item something actually happens! How do I do this? The method that handles the click ...

How do I add a ContextMenuStrip to a ToolStripButton?

I have a toolstrip containing, among other things, a ToolStripComboBox and a ToolStripButton. I want to add a ContextMenuStrip to both of them, but I don't have direct access to the toolstrip or its other contents, so I can't set the context menu of the toolstrip. Setting the ContextMenuStrip for the ToolStripComboBox is easy: myToolS...

How do I change the cursor for a ToolStripButton?

I want to change the user's cursor when they hover over a specific ToolStripButton, but not for the other items on the ToolStrip. How do I set the button's cursor? ...

How do I get a disabled ToolStripButton to paint its image in colour?

We have a button which allows users to 'lock' a form. Users are not permitted to 'unlock' the form, so when pressed, we want the button to be disabled, so that the user receives appropriate visual feedback. However, the customer reports that the greyed 'lock' icon suggests to them that the form is not locked, so we would like to displa...

How to capture ToolStripButton's ModiferKeys

I want to capture modifier keys to check whether Control, Shift or Alt is pressed when left mouse is clicked on ToolStripButton in a ToolStripButton.ButtonClicked event handler. The problem is that when I debug my app with VS 2005, I find no matter which key I pressed or not, the this.Control.ModifierKeys value is always None. But ...

How to deal with ToolStrip in Custom Windows Forms Base

Hello, I'll share my cue with everyone! My Form Base Class is frmExportBase.cs, so any Windows Form that I will create or use have to inherit from it, so this will be fine : namespace SResocentroAnalytics.Forms { public partial class frmExportCobranzaDiaria : frmExportBase { public frmExportCobranzaDiaria() { ...

How to change default image of derived ToolStripButton?

It seems like a simple task. Create a C# class that derives from ToolStripButton. The derived ToolStripButton should behave exactly the same as the parent class in the designer and the application, except that the default image should be different. Surprisingly just changing the constructor is not sufficient: public CustomToolStripButt...

Toolstripbutton text gets cut off in contextmenustrip

i am instantiating my own ToolStripButton and adding it to a contextmenustrip it pops up but the text gets cut off: string[] layouts = new string[]{"Test 1", "test 2", "test 3"} List<ToolStripButton> items = new List<ToolStripButton>(); foreach (string layout in layouts) { ToolStripBu...

ToolStripButton: what's wrong with assigning an image programmatically

Hi! There is a Form with a ToolStrip. This ToolStrip contains a ToolStripButton. I want to assign an image to this button: this.btnSaveFile.Image = Bitmap.FromFile("C:\\Work\\Icons\\png\\save.png"); It works only if there is save.png on specified path. Otherwise, I get an FileNotFound Exception. If I created a Form via Form Designer...

How to change System.Windows.Forms.ToolStripButton highlight/background color when checked?

Hi guys, I have a ToolStripButton that is used as a radio button. When it is checked, a blue outline surrounds the button, but there is no background color. It is not clear enough for the user that the button is checked, so I would like to change the background color to make the check state more visible. How do I go about changing the ...

ToolStripButtons BackGround property problem in winform.

My goal is totally fit image in toolStripButton and toolStripDropDownButton. If a image in the button set with image property, I can not totally fit the image in the button. Because of margin, border, or something of the button.(I don't know exactly). So I try to set the image in the button with BackgroudImage property. After I adjust ...

C# Question:Dynamically Disable ToolStripMenuItems/ToolStripButtons in an MDIParent Form: Which Event?

Any guidance on the following issue would be greatly appreciated. In which MDIParent event should I disable the items/buttons? Activated? On program Launch, I want the buttons disabled. If there are no active MDIChildren, I want the buttons disabled. When I launch a child form, I want to test that child form for data. If it is a blank fo...

Really strange ToolStripButton event problem

Hi all, I am making a CustomControl based on a ToolStripButton control, I am trying to know when the mouse is Hover the button to draw it differently. Here is a quick view of my code : private bool m_IsHover = false; ... protected override void OnMouseEnter(EventArgs e) { m_IsHover = true; Debu...

toolstripbutton with images for each state

hi all! I have in my app a ToolSrip with some ToolStripButtons. I wish add not only the basic image, but an image for the hover state and another for the clicked state, and if possible, remove the orange background when the button is hovered by the mouse... it's possible? thanks in advance! ...

toolstripbutton remove lighting

hi all! I have a toolstripbutton into my toolstrip, and I wish remove the orange lighting when a mouse is hover, 'cause I change the picture of the button dinamically.. how can I do this? thanks ...