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

Do I need to explicitly dispose a customized contextmenustrip

I have a class clsContextPopUpMenu to create a ContextMenuStrip with some basic functions (e.g.copy) that I can use in different controls. Friend Sub New(ByRef objControl As System.Windows.Forms.Control) m_objControlContainer = objControl …
Summer
  • 241
  • 2
  • 10
  • 23
0
votes
0 answers

.NET Winforms ContextMenuStrip TextBox functions but Focus:Enter, Leave, Validating, Validated events never fire

The title says it all really. I need to re-format the user entry after the textbox on a contextmenustrip loses focus - with the menu still open. Event(s) never fire - all types of focus events. Even after the menu closes. I see other posts on…
0
votes
0 answers

ConextMenuStrip not GC-ed after being displayed (Windows Forms .Net Framework)

I'm developing a (legacy) Windows Forms (.Net Framework 4.8) application with a main form and multiple child forms (the latter get opened and closed regularly by users). I started noticing memory leaks in our application and was able to trace them…
0
votes
1 answer

ToolStripMenuItem.Checked property does not set C# WinForms

I made a music player in C# and the only problem is the playlists context menu strip when you right click on the track. When the music is in a playlist, it checks; when it is not in a playlist, it is not checked. Note: the items are dynamically…
Error404
  • 55
  • 8
0
votes
1 answer

How to remove checked margin in tray icon context menu

I've created this little script running in tray. I've noticed that contex menu text is not placed completely to the left. After a little investigation I found out that it is because there is a space left for .checked state indicator. I found out…
Nawad-sama
  • 151
  • 2
  • 12
0
votes
1 answer

vb.net DataGridview show custom ContextMenuStrip on cell that is being edited

I'm trying to show a custom contextmenustrip on my datagridview and it works fine except when the cell is being being edited. Then it shows the default windows contextmenustrip with copy/cut/... Is there a way to overwrite the…
0
votes
0 answers

Measure ToolStripItem in custom ToolStrip renderer

I have a WinForms app for .NET Framework in which the text of items in context menus based on the the ContextMenuStrip component are drawn using Graphics.DrawString() to provide consistent look with other interface elements. The core part of the…
TecMan
  • 2,743
  • 2
  • 30
  • 64
0
votes
1 answer

Winforms' ContextmenuStrip and ChromiumWebBrowser

I need to show Winforms ContextMenuStrip but ChromiumWebBrowser gets in the way. By getting in the way I mean the ContextMenuStrip loses some of its significant behavior like the ability to process mouse and keyboard messages and auto closing when…
Abet
  • 123
  • 1
  • 5
0
votes
0 answers

ContextMenuStrip not copying to clipboard

This may be more of a RANT than question. That said the ContextMenuStrip is the worst control I have ever used.. Here is the process I added a ContextMenuStrip (CMS) to a RichTextBox then used a mouse click to show the menu. It takes two clicks to…
Vector
  • 3,066
  • 5
  • 27
  • 54
0
votes
1 answer

Why ContextMenuStrip is not opening at first time click from a button in C#?

I am currently developing a Matrix(layout) Popup Menu using a Form. Inside the popup menu, there's a Button. The button should open a ContextMenuStrip when left clicked, but not right clicked. With that, I didn't assign the ContextMenuStrip to the…
ewu11
  • 65
  • 9
0
votes
0 answers

Stuck ContextMenuStrip In Bottom Of Form

i use a scrollable form in visual studio 2022,also i use contextmenustrip.problem is when the form is long,contextmenustrip doesn't in right place in design time so i can't use it,it's mean i can't create toolStripMenuItem automatically and…
Saber
  • 27
  • 7
0
votes
1 answer

ContextMenuStrip disappears after a quarter second display

Well, I'm back. I solved the ListBox problem by using a ContextMenuStrip — or so I thought! It comes in perfect, then in a quarter second, two things happen: it disappears, and the TreeNode unselects. But for that quarter second, it looks…
0
votes
1 answer

ContextMenuStrip doesn't DPI scale when Form is dragged between monitors with different resolution/scaling (WinForms, .NET 6.0, PerMonitorV2)

The ContextMenuStrip doesn't scale when its parent Form is dragged between monitors of different resolution/scaling. The ContextMenuStrip is correctly shown with correct scaling for whatever screen it is first displayed on but then it (incorrectly)…
JohnC
  • 81
  • 1
  • 5
0
votes
0 answers

Why isn't the subitem displayed on the contextMenuStrip when called on the right-click event on the DatagridView?

When I call the context menu the DataGrdiView does not show the menu sub items. But if I call this menu by right clicking on the form, then everything works correctly. The photo shows the same menu. Called on the form and called on the…
GAAAN
  • 399
  • 2
  • 3
  • 14
0
votes
2 answers

Hide dummy taskbar icon for notification icon context menu

I have a simple .Net 5.0 WinForm form which is automatically hidden after the application started: private void form_Shown (object sender, EventArgs e) { Hide (); } It only creates a notify icon. This notify icon has a context menu strip that…
André
  • 405
  • 5
  • 16