contextmenustrip

Is there a way to force always show mnemonics in menus?

≯℡__Kan透↙ 提交于 2019-12-03 22:30:39
问题 I am making use of ContextMenuStrip in my program and apparently, it wont show its shortcut keys (mnemonics, those that should be shown as underlines under letters preceded by &) unless i press Alt, but when i press Alt, the shown ContextMenuStrip will hide because the main menu of the form will receive focus. Thus, in context menus, mnemonics are never seen! Is there a way to force this behavior to be on for my program? I've read elsewhere that you can change it somewhere in the system

Creating a transparent portion of a control to see controls underneath it

青春壹個敷衍的年華 提交于 2019-12-01 09:07:48
I've modified the SuperContextMenuStrip found at CodeProject to meet some of my projects needs. I'm using it as a tooltip for map markers on a GMap.NET Map Control . Here is a sample of what it looks like: What I would like to do is pretty this up a little by making it look more like a bubble. Similar to an old Google Maps stytle tooltip: I've spent some time searching on control transparency and I know this isn't an easy thing. This SO question in particular illustrates that. I have considered overriding the OnPaint method of the SuperContextMenuStrip to draw a background of the GMap.NET

Creating a transparent portion of a control to see controls underneath it

。_饼干妹妹 提交于 2019-12-01 06:37:16
问题 I've modified the SuperContextMenuStrip found at CodeProject to meet some of my projects needs. I'm using it as a tooltip for map markers on a GMap.NET Map Control. Here is a sample of what it looks like: What I would like to do is pretty this up a little by making it look more like a bubble. Similar to an old Google Maps stytle tooltip: I've spent some time searching on control transparency and I know this isn't an easy thing. This SO question in particular illustrates that. I have

Is there a way to force always show mnemonics in menus?

百般思念 提交于 2019-12-01 01:15:40
I am making use of ContextMenuStrip in my program and apparently, it wont show its shortcut keys (mnemonics, those that should be shown as underlines under letters preceded by &) unless i press Alt, but when i press Alt, the shown ContextMenuStrip will hide because the main menu of the form will receive focus. Thus, in context menus, mnemonics are never seen! Is there a way to force this behavior to be on for my program? I've read elsewhere that you can change it somewhere in the system settings, but i need people using my software to always see mnemonics, not require them globally changing

How do you get the control that was clicked to open a ContextMenuStrip?

佐手、 提交于 2019-11-29 04:01:18
I'm using a ContextMenuStrip for multiple controls and I'm trying to figure out the best way to get the control that was actually clicked on to open the Context Menu. The sender just gives the ToolStripMenuItem reference, which has an Owner property that references the ContextMenuStrip , but I cannot figure out how to tell which control the click came from. There must be a simple way to check this, right? I'm checking it in the ToolStripMenuItem 's click event. Friend WithEvents mnuWebCopy As System.Windows.Forms.ToolStripMenuItem ... Private Sub mnuWebCopy_Click(ByVal sender As Object, ByVal

How to add sub menu items in contextmenustrip using C#4.0?

心不动则不痛 提交于 2019-11-29 02:57:06
I have one contextmenustrip control associated with treenode. I have created one menu item in contextmenustrip manually in the form itself(for example named as "Assign"). Now I want to add sub menu items whenever user clicks this Assign item, it will create a list of users name as a sub menu item with checked or unchecked option. For example, once user clicked Assign then I want to show the user name dynamically. To add an item, you would call myContextMenuStrip.Items.Add("Item title", null, myClickHandler); To add a sub-menu, you take an existing item and do the same to it:

ContextMenuStrip.Owner Property null When Retrieving From Nested ToolStripMenuItem

对着背影说爱祢 提交于 2019-11-27 09:05:18
I have a ContextMenuStrip setup with two ToolStripItem s. The second ToolStripItem has two additional nested ToolStripItem s. I define this as: ContextMenuStrip cms = new ContextMenuStrip(); ToolStripMenuItem contextJumpTo = new ToolStripMenuItem(); ToolStripMenuItem contextJumpToHeatmap = new ToolStripMenuItem(); ToolStripMenuItem contextJumpToHeatmapStart = new ToolStripMenuItem(); ToolStripMenuItem contextJumpToHeatmapLast = new ToolStripMenuItem(); cms.Items.AddRange(new ToolStripItem[] { contextJumpTo, contextJumpToHeatmap}); cms.Size = new System.Drawing.Size(176, 148); contextJumpTo

How to add sub menu items in contextmenustrip using C#4.0?

喜你入骨 提交于 2019-11-27 03:05:01
问题 I have one contextmenustrip control associated with treenode. I have created one menu item in contextmenustrip manually in the form itself(for example named as "Assign"). Now I want to add sub menu items whenever user clicks this Assign item, it will create a list of users name as a sub menu item with checked or unchecked option. For example, once user clicked Assign then I want to show the user name dynamically. 回答1: To add an item, you would call myContextMenuStrip.Items.Add("Item title",

ContextMenuStrip.Owner Property null When Retrieving From Nested ToolStripMenuItem

狂风中的少年 提交于 2019-11-26 17:48:10
问题 I have a ContextMenuStrip setup with two ToolStripItem s. The second ToolStripItem has two additional nested ToolStripItem s. I define this as: ContextMenuStrip cms = new ContextMenuStrip(); ToolStripMenuItem contextJumpTo = new ToolStripMenuItem(); ToolStripMenuItem contextJumpToHeatmap = new ToolStripMenuItem(); ToolStripMenuItem contextJumpToHeatmapStart = new ToolStripMenuItem(); ToolStripMenuItem contextJumpToHeatmapLast = new ToolStripMenuItem(); cms.Items.AddRange(new ToolStripItem[] {

Determine what control the ContextMenuStrip was used on

痴心易碎 提交于 2019-11-26 15:21:17
I have a ContextMenuStrip that is assigned to several different listboxes. I am trying to figure out when the ContextMenuStrip is clicked what ListBox it was used on. I tried the code below as a start but it is not working. The sender has the correct value, but when I try to assign it to the menuSubmitted it is null. private void MenuViewDetails_Click(object sender, EventArgs e) { ContextMenu menuSubmitted = sender as ContextMenu; if (menuSubmitted != null) { Control sourceControl = menuSubmitted.SourceControl; } } Any help would be great. Thanks. Using the assistance below, I figured it out: