Questions tagged [contextmenustrip]

ContextMenuStrip should appear when a user right-clicks, reacting to the surroundings. It represents a shortcut menu in C#.

ContextMenuStrip replaces ContextMenu. You can associate a ContextMenuStrip with any control, and a right mouse click automatically displays the shortcut menu. You can show a ContextMenuStrip programmatically by using the Show method. ContextMenuStrip supports cancelable Opening and Closing events to handle dynamic population and multiple-click scenarios. ContextMenuStrip supports images, menu-item check state, text, access keys, shortcuts, and cascading menus.

For more details: http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip(v=vs.110).aspx

293 questions
0
votes
1 answer

how can i select a row in datagridview when i press right mouse button?

i have a form1 in which my datagridview is located. my form2 has a textbox in which the value is taken from the datagridview of form1. i have inserted a contextmenustrip in my datagridview which will then take the data from the selected row and pass…
0
votes
2 answers

How can I assign a context menu to a toolstrip menu item in winform?

I have a ToolStrip with a ToolStripDropDownButton to which I am adding ToolStripMenuItems in run time in my code. I need to have a default ContextMenuStrip and assign it to each menu item so when the user right clicks a menu item he will get that…
Liran Friedman
  • 4,027
  • 13
  • 53
  • 96
0
votes
1 answer

GDI objects memory leak: Custom ToolStripControlHost within ContextMenuStrip is not disposing

I have various custom context menus, based on ToolStripControlHost. They are wrapped inside ContextMenuStrip and placed in headers of DataGridView collumns (depending on some conditions) like this: if (this.DGV.Columns[DGVColname] != null) …
Arie
  • 5,251
  • 2
  • 33
  • 54
0
votes
1 answer

Disable automatic submenu show on hover in ContextMenuStrip

If I have a context menu with sub menu items, is it possible to stop the sub menu from popping out/displaying when I merely hover over the main menu item? And if so, how?
MrVimes
  • 3,212
  • 10
  • 39
  • 57
0
votes
1 answer

NotifyIcon Context Menu Slows Down

So, I have a [.NET] program that implements a NotifyIcon that persists in the Notification Tray in Windows for the entire time that the program runs. When I first execute the program, and for a small time afterwards, the NotifyIcon and associated…
SmithPlatts
  • 773
  • 7
  • 20
0
votes
1 answer

ContextMenuStrip item reference problem

I have searched on here and have not found exactly what I am looking for. I am using a ContextMenuStrip, within this there is one menu item that is a checked/unchecked item. The structure is the following: Top Level: Settings Middle Level:…
mattgcon
  • 4,768
  • 19
  • 69
  • 117
0
votes
2 answers

How can I write my own ContextMenu? C#

I feel quite limited by the default ContextMenuStrip, as it only can contain buttons, and no Controls. I was wondering that for a long time, and I already tried it, using forms, but it never really worked out. I already have I idea on how to set the…
Gregor A. Lamche
  • 402
  • 2
  • 5
  • 18
0
votes
1 answer

How to reach ToolStripMenu items of the contextMenuStrip?

I am new at C#. I have added a contextMenuStrip in the desing part, and also I added 4 different ToolStriptItem. Three of them are ToolStriptMenuItem, named like successToolStripMenuItem etc. , and one of them is ToolStripTextBox. What I want is to…
Burak Keceli
  • 933
  • 1
  • 15
  • 31
0
votes
1 answer

Display a logo in a contextmenustrip

I am developing a winforms application in .net 2.0. I am wondering how to display a logo in a contextmenustrip attached to a notification icon. It's not the kind of icon that displays next to text. It is the kind that spans the whole row and is…
Lan
  • 33
  • 1
  • 5
0
votes
2 answers

Terminate an application with ContextMenuStrip

I want to hide my application in system tray when I click the Form Closing button(clasic red X button). I provided with this code; private void Ana_FormClosing(object sender, FormClosingEventArgs e) { e.Cancel = true; …
Furkan İlhan
  • 65
  • 3
  • 10
0
votes
1 answer

TextImageRelationship is not working as expected in contextmenustrip - VB

Is it possible to align image above text in contextmenustrip item in vb? It is always Image being left of text.
user417397
  • 49
  • 3
0
votes
3 answers

c# set condition on contextmenustrip

is there anyway to set a condition such as: when i open a file, it loads some infos on a ListView, the fifth subitem (should be 4 on index count) is loading text, if it is "ETDF", enable an item in the contextmenustrip, if not, disable it, i tried…
Omarrrio
  • 1,075
  • 1
  • 16
  • 34
0
votes
1 answer

How to control sub menu items in dynamically created contextmenustrip items?

I have this task to be done : there is a contextmenustrip, where in one of the branches there are 3 static items (created via designer) and after that there will be dynamically created items (links to subfolders of one folder on hard drive). Here…
0
votes
0 answers

Custom ToolStrip renderer - DropDown items not appearing on hover

I have a ContextMenuStrip with a custom renderer class that paints the items according to the user's color choices. However, when the custom class is active, the items in the ContextMenuStrip must be clicked in order to bring up its DropDownItems -…
xpdite
  • 1
  • 1
0
votes
1 answer

Call DataGridView User Deleting Row using ContextMenuStip

I'm facing a problem to call the event [dgv_clients_UserDeletingRow] using a [ContextMenuStrip]. It's giving me that error: Unable to cast object of type 'System.EventArgs' to type 'System.Windows.Forms.DataGridViewRowCanelEventArgs' And here is…
vertebre
  • 19
  • 4