contextmenu

Can I create a multiple-column context menu in .NET Windows Forms?

我只是一个虾纸丫 提交于 2020-01-03 12:32:33
问题 I want to create a context menu that has several columns. Basically it would go like this: First item | [common option] | All Options > Second item | [common option] | All Options > Third item | [common option] | All Options > Fourth item | [common option] | All Options > So basically there are a bunch of items (generated at runtime), each item can be launched on its own; or with a commonly used option; or you can get a submenu with all possible options. How can I do this? I'm trying to abuse

Non-clickable Context Menu Header

五迷三道 提交于 2020-01-03 08:36:30
问题 When creating a context menu, is there a way to have header text included? For example, when a user clicks a button, I want a context menu to show with two options. There should also be text above the options, with a sentence such as: 'Please select an option'. Is this possible? 回答1: You can't do it with the designer but you can do it in code: public partial class Form1 : Form { public Form1() { InitializeComponent(); contextMenuStrip1.Items.Insert(0, new ToolStripLabel("Please select an

C# And windows explorer context menu?

青春壹個敷衍的年華 提交于 2020-01-03 05:14:21
问题 I have an idea for a little C# program, where I want to be able to right click on a file in windows explorer and somehow 'tag' that file. Subsequent right clicks would show it's tagged state. Bottom line is that I need to be able to right click on a file, see a custom menu item and perform a custom action as well as visualize some info. Never having done this, I'm not even sure where to start... :) Any good example out there? Things I should read up on? Links? Thanks! 回答1: The keyword you're

android: How to get the ID of a textview when clicked?

依然范特西╮ 提交于 2020-01-03 03:32:09
问题 I have an activity that queries from sqllite and display the output to xml this is part of the activity ( (TextView) view.findViewById(R.id.tv_id) ).setText( listItem.getId()+""); ( (TextView) view.findViewById(R.id.tv_name) ).setText( listItem.getName() ); ( (TextView) view.findViewById(R.id.tv_age) ).setText( listItem.getAge()+"" ); and this is the xml: <TableLayout android:layout_width="wrap_content" android:id="@+id/TableLayout01" android:layout_below="@+id/tv_age" android:layout_height=

How to get the PlacementTarget on WPF Context menu when item click using MVVM pattern

╄→гoц情女王★ 提交于 2020-01-03 00:56:11
问题 How to get the PlacementTarget of selected ContextMenu when using MVVM pattern ? I can get PlacementTarget like this when using MenuItem click event. But how it do it MVVM ? public void changeGaugeColor(object sender, RoutedEventArgs e) { MenuItem tempMenuItem = (MenuItem)sender; MenuItem mi = (MenuItem)sender; bd = (BidirectionalDial)cm.PlacementTarget; } 回答1: I realise that this is an old post, but someone might find this useful to know. Assuming that you have bound your view to your view

Can I add a custom paste option to the windows text editing context menu?

梦想与她 提交于 2020-01-03 00:00:28
问题 I am looking for a way to add an option(s) to the right click context menu when editing text on a WinXP machine. I already do a lot of copy/pasting on it, so the clipboard is always changing, but there is one string I type repeatedly in almost every file I edit. I've already added some custom option to the context menu for .zip files to batch unzip them, but I'm not having any luck finding a way to add this. The machine is used for a single purpose and I try to keep it as stable as possible

PrimeFaces ContextMenu on row hover

最后都变了- 提交于 2020-01-02 21:57:25
问题 I am trying to implement a ContextMenu that appears when mouse is over a row. I was able to implement the context menu on selected row, but could not find an event for hover. Do I have to write my own implementation for data table, or is there a way to attach the context menu to a hover event? 回答1: Primefaces's contextMenu doesn't have option to get that, so you can use jquery to do that. If you want to show contextMenu, you have to change contextMenu's position to Mouse's position(page load

How to add options to Android's native 'Edit text' context menu

大憨熊 提交于 2020-01-02 03:47:33
问题 Is it possible to add something to the list of items that shows up when a user long presses on any Edit Text? (Cut, copy paste, select text, select all, input method) I want to add another option to this menu, but cannot figure it out. There is a duplicate of this question here, and the last comment for the first answer says it's 'possible, but not pretty'. Then the thread dies. I'd really like to see any working example, dirty or not :) 回答1: Is it possible to add something to the list of

GWT: Select a TreeItem with right click

我们两清 提交于 2020-01-01 19:06:36
问题 I'm capturing a right click event to show a context menu. What I haven't been able to figure out, is how to make the right click actually select the TreeItem, prior to showing of context menu. All help is appreciated. private Tree tree = new Tree() { @Override public void onBrowserEvent(Event event) { if (event.getTypeInt() == Event.ONCONTEXTMENU) { DOM.eventPreventDefault(event); showContextMenu(event); } super.onBrowserEvent(event); } @Override protected void setElement(Element elem) {

Showing a Windows context menu for multiple items

旧城冷巷雨未停 提交于 2020-01-01 18:15:30
问题 I have an application that lists files, and I allow the user to right-click on a file and my application shows the Windows context menu for the selected file. I use SHParseDisplayName to get a pidl for a filename. Then I bind to the parent object: IntPtr pidlLast = IntPtr.Zero; SHBindToParent(pidl, typeof(IShellFolder).GUID, out oShellFolder, out pidlLast); After I have the parent I can get build the context menu: IntPtr result = IntPtr.Zero; IShellFolder shellFolder = (IShellFolder