contextmenu

How to add an icon to System.Windows.Forms.MenuItem?

喜你入骨 提交于 2019-12-01 05:51:42
I tried to add an icon to one of my context menu items, but I couldn't do it. Can anybody help me? Here's the code I've written: private System.Windows.Forms.ContextMenu notifyContextMenu; private void foo() { if (notifyIcon == null) { notifyIcon = new System.Windows.Forms.NotifyIcon(); } if (notifyContextMenu == null) { notifyContextMenu = new System.Windows.Forms.ContextMenu(); notifyContextMenu.MenuItems.Add("Exit"); // How do I add an icon to this context menu item? } notifyIcon.ContextMenu = notifyContextMenu; } } MainMenu/ContextMenu are obsolete, you should use the menu strip classes

VSTO WPF ContextMenu.MenuItem Click outside a TaskPane not raised

孤街浪徒 提交于 2019-12-01 04:08:31
问题 The Click Event form a Context Menu Item is not raised when the cursor is outside the taskpane. I have no idea how get it working. 90% of the time, the click is outside the task Pane. When the context menu is openned, the sub menus are often displayed outside the task pane (see picture below). In such cases, the click event from the context Menu is not raised. I have absolutly no idea how to make this work. Any ideas? 回答1: The Custom Task Pane has focus problems with WPF Context Menus. Look

How to have a VSTO Ribbon and Context Menu at the same time?

我与影子孤独终老i 提交于 2019-12-01 03:10:34
问题 EDIT: The posters answer is correct except for it should read xmlns="http://schemas.microsoft.com/office/2009/07/customui" for the include. As a side effect the ribbon and context menu defined in an XML file will not work in Office 2007. If you need to add a context menu in 2007, use the now deprecated, and a context menu within the Outlook 2007 message window is NOT POSSIBLE. this.Application.ItemContextMenuDisplay += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11

Do any browsers support HTML5's context menu?

时光怂恿深爱的人放手 提交于 2019-12-01 02:12:19
Do any browsers support the HTML5 context menu attribute ? johndrinkwater This has been added to Firefox 8. See this for an example of it working https://bug617528.bugzilla.mozilla.org/attachment.cgi?id=554309 Right now, the contextmenu attribute is not supported by any browser version. According to caniuse.com it doesn't have support for any current browser versions (IE 9, Firefox 4, Safari 5, Chrome 11, Opera 11.1, or any mobile browsers - iOS, Opera, or Android). It is unknown if it will be supported in future versions. It was discussed in April 2010 regarding adding it to Webkit. But it

Deleting items from ListView with a contextmenu in Android?

∥☆過路亽.° 提交于 2019-12-01 01:50:58
I'm trying to make a listmanager application in Android. I made a ListView, and an ArrayList into which I can add items with a button and an EditText. Then I made a context menu with an xml file, which I can delete listitems with, add new ones, edit them etc. The problem is that I don't know how to delete my items within the onContextItemSelected() method of my contextmenu. More precisely, I don't know how to refer to the listitems inside of this method, same with all the other operations, but I hope I can do them when I succeeded with the deleting. (Sorry for my bad english, it's been a while

popup window at chrome extensions' context menu

↘锁芯ラ 提交于 2019-12-01 01:30:07
问题 I'm developing a chrome extension and have a problem. I've added an item to chrome's context menu and want to open a popup window if the menu item is clicked. My code looks like this: function popup(url) { window.open(url, "window", "width=600,height=400,status=yes,scrollbars=yes,resizable=yes"); } chrome.contextMenus.create({"title": "Tumblr", "contexts":["page","selection","link","editable","image","video","audio"], "onclick": popup('http://example.com')}); But this code doesn't work as I

Check which submenu item was clicked in context menu strip

谁说我不能喝 提交于 2019-11-30 22:04:29
There is a ContextMenuStrip in a grid control. I have named it as GridContextMenu. The GridContextMenu is populated with 4 - 5 items using the following code : gridcontextMenu.Items.Add(new ToolStripMenuItem { Name = Plants, Text = Plants, Tag = Plants, Width = 100, Image = <image source is put here> }); gridcontextMenu.Items.Add(new ToolStripMenuItem { Name = Animals, Text = Animals, Tag = Animals, Width = 100, Image = <image source is put here> }); For the animal menu in tool strip, i added submenu in the following way (gridcontextMenu.Items[1] as ToolStripMenuItem).DropDownItems.Add("Tiger"

How to add a menu item to Excel 2010 Cell Context Menu - old code doesn't work

我们两清 提交于 2019-11-30 21:16:05
I've tried 3 different code samples and they all fail. Here's the code from a MSFT employee ( How to show a context menu on a range ), the other two samples have pretty much the exact same code: private void ThisAddIn_Startup(object sender, System.EventArgs e) { CommandBar cellbar = this.Application.CommandBars["Cell"]; CommandBarButton button = (CommandBarButton) cellbar.FindControl(MsoControlType.msoControlButton, 0, "MYRIGHTCLICKMENU", Missing.Value, Missing.Value); if (button == null) { // add the button button = (CommandBarButton) cellbar.Controls.Add(MsoControlType.msoControlButton,

Silverlight Datagrid select on right click

怎甘沉沦 提交于 2019-11-30 20:31:11
Is there a way for a right click event to select a row in toolkit datagrid? I'm using toolkit context menu which works nicely, but the problem is, only left click is able to select rows, and I need right click to be able to do that if I want my context menu to work properly. Any help is appreciated You can find a solution here . Basically it goes like this: private void dg_LoadingRow(object sender, DataGridRowEventArgs e) { e.Row.MouseRightButtonDown += new MouseButtonEventHandler(Row_MouseRightButtonDown); } void Row_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { dg

Bind Context Menu inside ItemsControl?

狂风中的少年 提交于 2019-11-30 16:04:33
问题 How can I add a ContextMenu to a ItemsControl, where: The ItemsSource of the ItemsControl is in the ViewModel of the UserControl holding the ItemsControl The CommandParameter of the Context Menu is the ViewModel binded to the Item in the ItemsControl. I followed this approach. However, I have a Command that Removes Items from the ObservableCollection binded to my ItemsControl. When this happen an exception is thrown inside the RelayCommand. It seems to me as the ContextMenu is not "hiding",