contextmenu

How to show menu item with icon AND text in WinForms system menu

本小妞迷上赌 提交于 2019-12-01 11:16:08
While adapting the answer of ygoe , I discovered that it's possible to add an icon to the menu. I tried and succeeded in doing so by using this code for a text-only item: var item = new MenuItemInfo { cbSize = (uint)Marshal.SizeOf(typeof(MenuItemInfo)), cch = (uint)label.Length, dwTypeData = label, fMask = 0x2 | 0x10, // MIIM_ID | MIIM_TYPE fState = 0x0, // MFS_ENABLED fType = 0x0, // MFT_STRING wID = id }; InsertMenuItem(hMenu, 0, true, ref item); For an icon-based item, I changed fMask and added hbmpItem like this: var item = new MenuItemInfo { cbSize = (uint)Marshal.SizeOf(typeof

Persisting a context menu after screen rotation

半城伤御伤魂 提交于 2019-12-01 09:08:39
I have an activity that on it's onCreate method it does: registerForContextMenu(theView); and in onCreateContextMenu: super.onCreateContextMenu(menu, v, menuInfo); menu.add(blablabla); This works great, but the problem is that the context menu disappears when the screen rotates. How to fix this? Thanks for reading! Macarse Here's the solution: The contextMenu disappeared because by default when rotating android calls destroy() and then onCreate() but : If you don't want Android to go through the normal activity destroy-and-recreate process; instead, you want to handle recreating the views

Disable and enable jQuery context menu

天涯浪子 提交于 2019-12-01 08:46:40
问题 I use $('#test').unbind('click'); to remove the click event on the #test item. How do I make the item clickable again? Actually I have a table. On click event a context menu appears. But if there are no entries the menu has to be disabled. So I use unbind above. Since the context menu is generated by a plugin I do not know how to make it clickable again. Any ideas? Update: this is how the context menu is set up $('#contacts tbody tr').contextMenu('myMenu1', { bindings: { 'sms': function(t) {}

WebBrowser ContextMenu run action of menu item

时光总嘲笑我的痴心妄想 提交于 2019-12-01 08:38:57
问题 I have an application with a WebBrowser Control. I load a page to it with a button click. Then I want to run a "Convert to Adobe PDF" action from the context menu of the web browser but... when I try to access the context menu by: foreach (MenuItem vMenuItem in WebBrowser.ContextMenu.MenuItems) { if (vMenuItem.Text.Contains("onwert") && vMenuItem.Text.Contains("PDF")) { vMenuItem.PerformClick(); } } The IDE displays an error "Object reference not set to an instance of an object" on line with

How to add an entry to toolbar context menu in qt?

岁酱吖の 提交于 2019-12-01 08:26:49
问题 By default the context menu of a toolbar is filled with the names of the toolbars. I would like to extend this context menu by an additional entry. I found an example extending the context menu of a QTextEdit element. http://www.qtcentre.org/threads/35166-extend-the-standard-context-menu-of-qtextedit However, it uses the createStandardContextMenu of the QTextEdit class. But QToolBar appears not to have that property: http://doc.qt.io/qt-4.8/qtoolbar.html Edit Apparently, the default context

Finding and simulating a click on a system tray icon?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 07:27:06
问题 I need to figure out how to programmatically find and select a context menu item from a separate application's system tray icon. The only way I could imagine accomplishing this was to use mouse_event() with some hard-coded x/y values, and set the icon to always be shown. Aside from the hacky use of hard-coding in general, the problem here is the assumption that the icon will retain it's position (which is likely to break any time another application loads/unloads). I was wondering if anybody

How to show menu item with icon AND text in WinForms system menu

孤者浪人 提交于 2019-12-01 07:26:57
问题 While adapting the answer of ygoe, I discovered that it's possible to add an icon to the menu. I tried and succeeded in doing so by using this code for a text-only item: var item = new MenuItemInfo { cbSize = (uint)Marshal.SizeOf(typeof(MenuItemInfo)), cch = (uint)label.Length, dwTypeData = label, fMask = 0x2 | 0x10, // MIIM_ID | MIIM_TYPE fState = 0x0, // MFS_ENABLED fType = 0x0, // MFT_STRING wID = id }; InsertMenuItem(hMenu, 0, true, ref item); For an icon-based item, I changed fMask and

WPF UserControl Context Menu Visibility Binding

左心房为你撑大大i 提交于 2019-12-01 06:38:48
My user control context menu visibility can't bind a dependency property. Any idea? Here is my WPF code <UserControl.ContextMenu> <ContextMenu Visibility="{Binding ElementName=wellControl, Path=IsInCompactMode, Converter={StaticResource BooleanToVisibilityConverter}}"> <MenuItem Command="local:GCommands.Edit" /> <MenuItem Command="local:GCommands.Delete" /> <MenuItem Command="local:GCommands.ExportFcsFiles" /> <MenuItem Command="local:GCommands.BatchExportStatistics" /> <Separator/> <MenuItem Command="local:GCommands.SaveAs" Header="Save As..." /> </ContextMenu> </UserControl.ContextMenu> If I

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

余生颓废 提交于 2019-12-01 06:05:24
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_ItemContextMenuDisplayEventHandler(Application_ItemContextMenuDisplay); I've created both a Ribbon and a Context menu,

VSTO WPF ContextMenu.MenuItem Click outside a TaskPane not raised

放肆的年华 提交于 2019-12-01 06:05:09
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? The Custom Task Pane has focus problems with WPF Context Menus. Look here . I have the same problems. Actually I use one of the recommended workarounds ( Dispatcher Frame ). Is