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
3 answers

Add a Menu on the Button in c#

I want to create a button that when clicked, a menu will be shown. I want it to look like this (with an arrow on the side): I tried the following code on the onClick event: Button btnSender = (Button)sender; Point ptLowerLeft = new Point(0,…
ThEpRoGrAmMiNgNoOb
  • 1,256
  • 3
  • 23
  • 46
0
votes
1 answer

How to check a subitem in ContextMenuStrip

(cms.Items[6] as ToolStripMenuItem).DropDownItems.Add("Close program",null, new EventHandler(CloseProgram_Click)); (cms.Items[6] as ToolStripMenuItem).DropDownItems.Add("Show message", null, new EventHandler(ShowMessage_Click)); (cms.Items[6] as…
KayTran
  • 11
  • 4
0
votes
0 answers

Reproducing "on focus" when minimizing another window on a context menu strip click

I would like to reproduce the "on focus" behavior when you minimize an application on a context menu strip (I need that in C#), let me explain why: When you minimize a window, the focus will be restored to the previous application that was used…
Dyr Fenrir
  • 129
  • 2
  • 15
0
votes
1 answer

How to access the event when a list of radio button is selected at a context menu strip?

I'm creating the radio buttons in the ContextMenuStrip using the ToolStripControlHost, this way RadioButton taskRb = new RadioButton(); taskRb.Text = DataGridTable.getTasks()[i].name.ToString(); taskRb.Checked = false; ToolStripControlHost tRb = new…
0
votes
1 answer

Deleting a Specific Item from multiple listboxes

I'm trying to delete a specific item from multiple listBoxes. I've created a ContextMenuStrip which contains a Delete Button. I can delete the listbox item by clicking a right click on the mouse and pressing the delete button on the…
user2992413
  • 77
  • 1
  • 8
0
votes
1 answer

Position of ContextMenu vs ContextMenuStrip

I am trying to add the first ContextMenuStrip to an application, as a menu. However only ContextMenu's appear within the bounds of the application window, ContextMenuStrips appear outside of the application window. This application I have started…
Tom Jones
  • 11
  • 2
0
votes
1 answer

Disable few menus upon opening when item is selected in listbox

I want to disable few item in a contextmenu or menustrip when an item in listbox is selected, I manage to do it in a listview control but I can't convert it to listbox, there is no ListItem in listbox control, can i do it using this code, or perhaps…
mercenary
  • 69
  • 2
  • 11
0
votes
0 answers

How to have application's Contextmenu user settings remembered when opened next time?

Using Visual Studio 2010 Ultimate. I've added a contextmenustrip with four options - options A, B, C and D on my form. I've written these in such a way that only one remains checked at a given time. It works fine while using. But I would like to…
Ganesh
  • 1
  • 3
0
votes
1 answer

Controls with ContextMenuStrip

I am using VS2012, C#, Winforms. My application generates about 100 label controls at runtime. I want the user to right-click on a label control, bring up a context menu strip. I have this part working. But I am having trouble determining which…
cmh2001
  • 23
  • 1
  • 7
0
votes
1 answer

How do change the arrow symbol of the contextmenu to another symbol?

I need to change the Symbol check arrow of the contextmenustrip to a another symbol as dot in below pic: How do i so that?
0
votes
0 answers

C# Winform context menu strip delete function

I want to create a delete function in context menu strip something like this: I have created the code but it is not functioning. am I wrong or is there any other method to do this? private void deleteToolStripMenuItem_Click(object sender,…
Ren
  • 765
  • 4
  • 15
  • 42
0
votes
1 answer

How to display a ContextMenuStrip on a ToolStripMenuItem?

In Winforms, I want to display a ContextMenuStrip when the user right-clicks on a ToolStripMenuItem. For example (see the image below), in Firefox there is Bookmarks menu and when we right-click on one of the bookmarks, a context menu item will be…
Setyo N
  • 1,953
  • 2
  • 26
  • 28
0
votes
3 answers

Menu click causes form to "lose focus" and menu dropdown disappears

I have noticed some strange form interactions while using a ContextMenuStrip or a MenuStrip. I don't really know what is causing it so the following should create a repeatable test for anyone looking into this: I've created two Windows Forms: Form1…
VineAndBranches
  • 468
  • 3
  • 7
0
votes
2 answers

Identify source chart/control from ContextMenuStrip Click

I have a form with numerous charts and have added a ContextMenuStrip when a chart is right clicked so the user can copy the chart image to the clipboard Public Sub Chart_Click(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles…
0
votes
3 answers

DataGridView and Right Click

I have a DataGridView linked to a ContextMenuStrip. The DataGridView is populated. I select a row (any cell) and when I right click, it opens a menu, where I can choose Edit, Rename or Delete. How can I pass the row number of the selected row to my…
Nick_F
  • 1,103
  • 2
  • 13
  • 30