contextmenu

Visual Studio addin: context menu for all files

I created this Visual Studio addin a while ago for saving shortcuts to files as a more extensible alternative to an MRU. The problem I've had with it since the start is the context menu item only appears for source code files - not .sql, .js, .aspx and so on. This is a snippet of the code used for registering the context menu item: Co...

Native menu in C#

What is the best method of using native menus in C#? Edit: I want to use the native menu because it's better looking than the ugly .NET menu. Can someone explain to me exactly how I can use it? ...

Help getting me started on making a file -> right-click context menu in Vista

I am a novice .Net 2.0 and 3.5 developer. I want to create an application that creates a context menu when a file is right clicked on in Vista. After the right click--I think I can figure out the rest, but I don't know the technique to get access to the Vista API. FOLLOW-UP: As I have been reading some of the info that folks have r...

Eclipse RCP: Suppress the context menu of the persective bar

I would like to suppress the context menu that shows when right clicking on the perspective tool bar in an rcp application. To clarify, I do want the perspective bar and shortcuts to show, but I do not want the context menu to pop up. All perspective tool bar api seems to be internal. Thanks. ...

How to programmatically choose a context menu item in another app?

The target app is written in Delphi (win32 not .NET) and is closed-source. The action I want to invoke is called Copy, but there is no obvious keyboard shortcut. (Ctrl+Insert does the wrong thing and Ctrl+C does nothing) I can find my target HWND and persuade it to open the context menu (it responds to WM_RBUTTONDOWN/UP not WM_CONTEXTM...

Single click to open menu for tray icon in C#

How do i force a context menu for a tray icon to be shown when it is click rather than just right-clicked. Ive tried using the MouseClick event, but the eventargs have the mouse position at x0y0. ...

WPF hide MenuItem on ContextMenu based on object property

I need to programatically show/hide a MenuItem, what would be the best way to do this? ...

WPF ContextMenu

I am using mvvm in a wpf app. I have a ContextMenu inside of a listview and when I right click a listviewitem i want a contextmenu to display a list of Contacts. The following just gives me a contextmenu with no content. Can anyone tell me what I'm doing wrong? <ListView Grid.Row="3" ItemsSource="{Binding Path=Phones}" ...

click a context menu item using sendmessage (or similar function)

hi, I need to right click on another application, gets it context menu (that was opened after the right click), and than select an item from it. I can use the postMessage with the other application handle, and as a results the requested context menu did appear, but I have no idea of how to select from it. public const int WM_R...

WPF c# Context Menu Text Alignment

Hi, i am building a context menu for a WPF c# application and just for simplicity's sake, if i have text and then i add an image, the text is always aligned at the top of the menu items cell and i cant figure out how to align it to the center. i have tried the veticalalignment property and veticalcontentalignment property but they dont h...

How can I add a context menu to a tree node in Gtk#?

I want to add a context menu to a tree node that allows me to delete that tree node. ...

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

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...

C#: How to detect who is the caller of a context menu's menu item when linked to two different objects?

C#: How to detect who is the caller of a context menu's menu item when linked to two different objects? I have two labels, lblOn and lblOff. I am linking 'one' contextmenu to both labels to discard having to make two of the same. How would I go upon finding out which label object called the contextmenu.menuitem? That way the clicked o...

Imitating a context menu in Gtk#/gtk-sharp

Is there some way to use the Menu.AttachToWidget(...) function of a gtk menu item to attach the menu to say a Gtk.Textview and have it handle showing the menu when needed. Or is creating an event handler for ButtonPressEvent and showing the menu there the only way to do it? Or is there a third possibility that I'm missing? Thanks in Ad...

Adding a Menu item to the context Menu in a VS2008 DSL

I'm currently trying to create a Bi-directional DSL for the company I'm working for and want to add a context menu to the diagram to provide a mechanism for the user to request a code import. I know that in VS2005 the Commands.ctc file is used to achieve this and 2008 appears to be using Commands.ctc. However its not very easy trying to ...

Send KeyEvent from a Form to a Control

I have a Windows.Worms application. In one of my forms I display a DataGridView with a ContextMenu (not ContextMenuStrip) associated to it. The MenuItems in the ContextMenu have Shortcuts defined. This is how the ContextMenu is created: Private _contextMenu As _ New ContextMenu( _ New MenuItem() { _ ...

ElementName Binding from MenuItem in ContextMenu

Has anybody else noticed that Bindings with ElementName do not resolve correctly for MenuItem objects that are contained within ContextMenu objects? Check out this sample: <Window x:Class="EmptyWPF.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ...

Bind ContextMenu's MenuItem visibility to ListView selection

I have a user control with a ListView containing simple items from an ObservableCollection. I would like the ContextMenu of that ListView to contain items depending on what's selected in the ListView. If no item is selected, some MenuItems should not be visible. My converter isn't even called when I open the ContextMenu. The binding se...

C# - TreeView construction

I am trying to construct a TreeView from a Menu. My Code is like this: public class MenuExtractionUtility { public TreeView MenuTraverse(MainMenu mainMenu) { TreeView treeView = new TreeView(); TreeNode mainNode = new TreeNode(); foreach (MenuItem mi in mainMenu.MenuItems) ...

wpf listview right-click problem

so I have attached a context menu (right-click menu) to a wpf listview. unfortunately, when you right-click it brings up both the menu and selects whatever item you are over. Is there a way to shut off this right-click select behavior while still allowing the context menu? ...