contextmenu

C# - Detecting if the SHIFT key is held when opening a context menu

江枫思渺然 提交于 2019-11-29 15:53:54
问题 In my C# application I want to display a context menu, but I want to add special options to the menu if the SHIFT key is being held down when the context menu is opened. I'm currently using the GetKeyState API to check for the SHIFT key. It works fine on my computer but users with non-English Windows say it doesn't work at all for them. I also read that in the Win32 API when a context menu is opened there's a flag that indicates in the menu should show EXTENDEDVERBS . In C# the EventArgs for

How to add line divider for menu item Android

核能气质少年 提交于 2019-11-29 12:19:31
问题 My menu item become bigger so that I want group them and make a line divider to separate each group. What should I do now ? <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <!--group1--> <item android:id="@+id/action_addtag" android:title="@string/add_hashtag_string" app:showAsAction="never" /> <item android:id="@+id/action_block_list" android:title="Block" app:showAsAction="never" /> <item android:id="@+id/action_report

How do you override the ContextMenu that appears when right clicking on winforms WebBrowser Control?

懵懂的女人 提交于 2019-11-29 11:45:57
When you right click on WebBrowser control, the standard IE context menu with options such as "Back", "View Source", etc. appears. How do I make my own ContextMenuStrip appear instead? WebBrowser.ContextMenuStrip doesn't work for this Control. blak3r A lot of the other solutions on this site made it sound like this was very difficult to do because it was a COM object... and recommended adding a new class "ExtendedWebBrowser". For this task, it turns out to be pretty simple. In your code which adds a web browser control, add the DocumentCompleted event handler. WebBrowser webBrowser1 = new

Python: Get a list of selected files in Explorer (WIndows 7)

喜夏-厌秋 提交于 2019-11-29 11:16:33
At work I can select multiple .xlsx files, and right clicking on one file will give me the option of combining the files to make a .pdf. Now I want to use the same functionality in one of my scripts. That is, selecting multiple files and send the paths of these files as arguments to a Python script. I've spent soon an hour searching for solutions, but I haven't found any good answers. It seems there are some C# answers, but I don't know how to convert the code to Python. Is it even possible to achieve it at all? Edit - Sample script: import sys, os for file in sys.argv: print(file) os.system(

jQuery Context Menu clashes with jQuery Draggable

为君一笑 提交于 2019-11-29 11:01:12
I'm trying the jQuery Context Menu with jQuery Draggable rows in a jQGrid . The problem I'm having is that since I added the jQuery Context Menu the draggable action is triggered on single click (as well as the normal drag). It looks a little weird when I rightclick a row to get the menu, and then click outside it on another row (to discard the menu) and that row starts following the cursor. Does it have to do with the evt.stopPropagation(); in the following snippet from jQuery Context Menu? $(this).mousedown( function(e) { var evt = e; evt.stopPropagation(); $(this).mouseup( function(e) { e

onCreateContextMenu() for EditText doesn't work on real device

二次信任 提交于 2019-11-29 10:28:08
问题 Just tried to test my app on real device (HTC Desire Z with Android 2.2). And found that my context menus doesn't work at all on EditText s. Otherwise context menus works: in ListView , ImageView and so on. On emulator everything works fine... When I tap on EditText it shows something like zoom frame and then shows unusual (not standard Android alike) context menu which reads: "select text", "select all". It doesn't show my menus. Here are screenshots: Before tap During tap After tap (just

Showing windows (file/directory) context menu in c# winforms application

无人久伴 提交于 2019-11-29 10:23:15
I'm trying to display standard file/directory context menu in WinForms application - I'd like to enable the user to do things with files in my application as he could in Explorer. There should be two options popup the context menu with some system call read everything from the system context menu and insert it into my context menu Could you please point me in the right direction? Thanks I have written a .NET library to allow this. You can find it here: http://gong-shell.sourceforge.net/ The class you're looking for is ShellContextMenu within that library. This may prove to be very challenging,

How to respond to a ContextMenuStrip item click

痞子三分冷 提交于 2019-11-29 09:07:37
Currently I have the following code: ContextMenuStrip contexMenuuu = new ContextMenuStrip(); contexMenuuu.Items.Add("Edit "); contexMenuuu.Items.Add("Delete " ); contexMenuuu.Show(); How can I add an event to be processed when an item gets clicked? DevExpress Team This can be done using the following code: ContextMenuStrip contexMenu = new ContextMenuStrip(); contexMenu.Items.Add("Edit "); contexMenu.Items.Add("Delete "); contexMenu.Show(); contexMenu.ItemClicked += new ToolStripItemClickedEventHandler( contexMenu_ItemClicked); // ... void contexMenu_ItemClicked(object sender,

Create windows right click context menu for SPECIFIC folders

我们两清 提交于 2019-11-29 07:55:37
How can I create a context menu that appears for files/folders inside a particular folder. Say there is a directory "D:\RandomCodes" How do I create a custom context menu item "Open in MyApp" for any file/folder inside this? This menu item should not appear for any other directory. I know if I add the entry in HKCR/Directory/Shell, it'll work, but then it'll appear for all files and folders everywhere. Please guide me through this. Is possible modifing your code for IShellExtInit: STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pidl,LPDATAOBJECT pDataObj,HKEY hk) { // Initialize can be called

WPF Context Menus in Caliburn Micro

╄→гoц情女王★ 提交于 2019-11-29 07:17:52
问题 I'm trying to get a context menu within a ListBox ItemTemplate to call a method on the parent view model, passing in the item that was clicked on as a parameter. I have this working for other buttons in the item template, but for the context menu it seems to be failing. I have the following xaml (abbreviated for clarity): <ListBox> <ListBox.GroupStyle> <GroupStyle> ... </GroupStyle> </ListBox.GroupStyle> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ContextMenu> <ContextMenu Name="cm">