Questions tagged [toolstripitem]

49 questions
14
votes
3 answers

How to change the checked state of a ToolStripItem in Winforms?

When I look it up, they list it as having a .Checked property. But both in Visual Studio and on msdn, it doesn't list any kid of Checked property. ContextMenuStrip menu = new ContextMenuStrip ( ); var menuItem = menu.Items.Add ( "CheckedItem"…
Joan Venge
  • 315,713
  • 212
  • 479
  • 689
10
votes
5 answers

Check only one ToolStripMenuItem

I have a ToolStrip with multiple ToolStripDropDownButtons, each has a set of DropDownItems. When the user clicks on an DropDownItem, the check mark is shown. By default, multiple items can be clicked and therefore multiple check marks appear. What…
Isuru
  • 30,617
  • 60
  • 187
  • 303
10
votes
2 answers

Adding Items to ToolStrip at RunTime

Hello I have a ToolStripMenu with a "Favorites" menu that I want to add sub items to during my WinForms app at run time. I have a datagridview that I right click on to show a context menu that has an "Add to Favorites" option. When that event is…
ikathegreat
  • 2,311
  • 9
  • 49
  • 80
6
votes
3 answers

How to remove right side empty space in ToolStripMenuItem

In screenshot i marked that empty space with green rectangle, i want left and right space to be equal size in ToolStripMenuItem but right side have bigger empty area which i can't remove. Codes: private void UpdateWorkflowsMenu() { …
Jaex
  • 4,204
  • 2
  • 34
  • 56
4
votes
4 answers

Mouse wheel scrolling Toolstrip menu items

I have some menus that contain many menuitems. Mouse wheel doesn't scroll them. I have to use the keyboard arrows or click the arrows at top and bottom. Is it possible to use the mouse wheel to scroll toolstrip menu items? Thanks
Jerry
  • 4,258
  • 3
  • 31
  • 58
4
votes
2 answers

Can't resize ToolStripItem programmatically in ToolStrip with ToolStripLayoutStyle.Table

I want to filling the ToolStrip with items programmatically. The toolStrip1.LayoutStyle must be ToolStripLayoutStyle.Table. But i can't change Width of item, even i've do that, the Width restores to default. ToolStripLabel tslCheck = new…
gam6itko
  • 15,128
  • 2
  • 19
  • 18
3
votes
1 answer

"Pin" control over items in ToolstripMenu

First, a little overview of how my current UI looks like: Note that other than the stuff in the ToolStripControlHost, everything else is standard WinForms. In short, I want to have something similar to the ToolStripControlHost but I need it…
Christian
  • 27,509
  • 17
  • 111
  • 155
3
votes
1 answer

ToolStripControlHost with Icon and checkbox. How Hightlight selected item? Add Icon in Icon field?

I wanted to create Custom ToolStripItem that will have checkbox and Icon in it. I menage to do that by creating Custom Control with two picturebox and label. Left picturebox if for icon and right is acting as special checkbox to add position to…
GryzLi
  • 139
  • 1
  • 9
2
votes
2 answers

Setting ToolStripMenuItem.Visible to true doesn't work

I have a TreeView control for which each node in it I want to share a ContextMenuStrip which has two ToolStripMenuItems ie: this.BuildTree = new MyApp.MainForm.TreeView(); this.ItemMenuStrip = new…
user176168
  • 1,294
  • 1
  • 20
  • 30
2
votes
2 answers

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

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…
James
  • 2,404
  • 2
  • 28
  • 33
2
votes
1 answer

ToolStripLabel not updated with application settings using PropertyBinding

I probably have a very simple problem, but could not find a solution. I have a problem with the property binding to a ToolStripLabel. A Label is bound to COM port value in App.Config. If I bind the property for a System.Windows.Forms.Label label,…
Sasha
  • 23
  • 5
2
votes
2 answers

Access and disable ToolStripItems (ToolStripButtons, ToolStripMenuItems) using their names

I would like to disable UI elements (Controls, Components etc.) which names are stored in a database. My code works for Controls, but I would like to access (to disable them) ToolStripItems such as ToolStripButtons, ToolStripMenuItems etc.. This…
CJ Caimoy
  • 51
  • 6
2
votes
2 answers

How to add two ToolStripComboBox and Separator Horizontally to one ToolStripDropMenuItem?

I think that this should be simple to do. But I haven't seen it. I'd like to do something like: DropDown -> DropDownItem1 [ComboBox1 [|] ComboBox2], DropDownItem2 [...], DropDownItem3 [...]; I'm using ToolStripDropDownButton in a ToolStrip. I'm…
2
votes
1 answer

Display UAC shield icon on a ToolStripItem

is there a recommended way (like sending BCM_SETSHIELD to a button control) to display the UAC Shield icon on a ToolStripItem? ToolStripItem is not a control anyway, so i wonder what the best-practise for that is. Thanks.
esskar
  • 10,638
  • 3
  • 36
  • 57
2
votes
1 answer

How to open form at toolstrip button position

I have toolstrip menu with some buttons, menu is located in toolstrip container. What I am trying to accomplish is to open new form exactly at specific toolstripbutton location... This is my code. It works unless I move toolstrip menu to bottom or…
Adlorem
  • 1,457
  • 1
  • 11
  • 10
1
2 3 4