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

C# WinForm: contextMenuStrip throws InvalidOperationException after .Show() method when called from BackgroundWorker_ProgressChanged event

I have a WindowsForm in C# with a TrayIcon including a contextMenuStrip with a ToolStripTextBox, a FileSystemWatcher and a BackgroundWorker. The FileSystemWatcher throws an event when a new file is created which then starts the BackgroundWorker. The…
0
votes
2 answers

Identify List View from contextMenuStrip click

I have 8 listViews controls in my C# program. I have just one contextMenuStrip that they all reference. How can I know which listView control triggered the contextMenuStrip selection?
TKO
  • 29
  • 5
0
votes
1 answer

about contextmenustrip

I've added contextmenustrip control at the time of designing of my application. And i want to edit that contxt menu at run time. And i want to add another menu & submenu on that context menu. And i want to add handler function for that runtime…
Priyanka
  • 2,802
  • 14
  • 55
  • 88
0
votes
0 answers

Winforms ContextMenuStrip wont open when Opening event is handled

I'm moving a Winforms app from VB to C#. I have a TrueDBGrid with a ContextMenuStrip thats pops up on a right click. When I don't handle the mnuContext Opening event the menu pops up. When I do handle the event the handler is called but the menu…
Craig
  • 517
  • 1
  • 9
  • 17
0
votes
1 answer

How to return the name of a ToolStripMenuItem inside of a sub menu in a ContextMenuStrip in .Net

My question might be ambiguous but here is my situation : I have a square array of pictureboxes on my form, each has a handler to open the ContextMenuStrip whose content is generated based on a directory. Each folder in the directory will create a…
Tristan Dubé
  • 702
  • 1
  • 15
  • 30
0
votes
1 answer

CurrentRow in Data Grid giving first row after Selecting differant Row

I have a C# project (VS 2017) that uses a Data Grid View to show data in an object list. Using a contextMenuStrip I want to be able to right click on a row and be able to remove it from the datagridview and the underlying datasource. I have the…
G.Glass
  • 3
  • 3
0
votes
0 answers

How to set ContextMenuStrip image smoothing mode?

I would like to have better quality of images of ToolStripMenuItems, so that they do not look pixelated. Source code 1 private void button2_Click(object sender, EventArgs e) { ContextMenuStrip cms = new ContextMenuStrip(); …
silviubogan
  • 3,343
  • 3
  • 31
  • 57
0
votes
1 answer

Right clicking notifyicon in system tray does not show contextmenu

I am trying to use a contextmenustrip with a notifyicon. When I right click on the notifyicon, the contextmenustrip does not show. I haven't found any solutions on the web. Here is my code: public class Program { static ContextMenuStrip…
user6336284
0
votes
1 answer

C# File Copy and Paste

I am currently working with Copy and Paste with Item (file name) in Listbox. There's no error but copy and paste seems to not be working. I am new to this so I don't know what is the problem here, any help would be appreciated. Code in Copy …
0
votes
1 answer

How to check if mouse is on the context menu strip

I am having a winform that contains a button which has a context menu strip dropping down when mouse hovers on it. The condition checking whether the mouse is on the context menu strip is not working in the button's mouse leave event. private void…
0
votes
0 answers

c# adding a contextmenu to a datagridview

I have a component derived from DatagridView. I want to show a context menu when the user righ-click a cell. The problem is that the menu shows itself always at the origin of the screen, instead of the given coordinates. My try: this.MouseDown +=…
user1238784
  • 2,250
  • 3
  • 22
  • 41
0
votes
1 answer

Radio button on the ContextMenu or ContextMenuStrip [winforms]

I am searching for the way to implement a context menu item with radio button appearance like this: Windows 7's ContextMenu with RadioButton menu item I have search through Google and SO, this post Adding RadioButtons to ContextMenu is close, but…
nambk
  • 445
  • 3
  • 13
0
votes
1 answer

C# - Standalone ContextMenuStrip - Some frustrations

I'm trying to make a program that basically is a ContextMenuStrip, where users can add their own shortcuts and so on and access the menu by pressing a hotkey combination. The way I make the menu appear is by giving the main form 0% opacity, but if…
0
votes
0 answers

System.io.filenotfoundexception image not found after installation

I created a WPF app using c# in which I have ContextMenuStrip with images.. I am using custom action to launch my application after installation.. As App launches first time it gives me exception System.IO.FileNotFoundException but when it is…
0
votes
2 answers

Contextmenustrip submenu itemclicked event not fired

I have a Contextmenustrip menu. One item has a submneu. When user clicks on a main item of menu, the "ItemClicked" event fires, but Clicking on a submenu items, does not fire the "ItemClicked" event. How can i get the "ItemClicked" event by clicking…
hrkad
  • 105
  • 8