contextmenu

C# WinForms - TreeView, Context Menu

Suppose I am using a context menu to add child nodes to a treeview control. (1) I am right-clicking on the node (2)context menu pop up (3)then I click "Add" menu item (4)a dialogBox opens up (5) I input the name in that DialogBox and press OK (6) A new Node is created. How can I get the reference of the current Node when I am clic...

Binding a context menu to a ListBox's Items collection

Hello, I'm trying to create a context menu for a list box which displays elements in the context menu from the list box. I am able to accomplish this by using the following XAML: <Window.Resources> <ContextMenu x:Key="contextMenu" ItemsSource="{Binding Items, RelativeSource={RelativeSource FindAn...

Hyperlinks in contextMenues (wpf, partial trust) didn't work

Hi guys, I got a problem. I have a contextmenu and it's items are hyperlinks. If I click on those nothing happened. They are OK, because if I add them to a grid they work fine. Anybody an idea how to solve this? I am in an partialTrust environment ... so Process.start is not running. ...

Unable to set System.Windows.Controls.MenuItem.Icon thru a setter

Hi I am trying to have a MenuItem.Icon set thru a style setter: <Style x:Key="MenuItem_Delete" TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}"> <Setter Property="Header" Value="_Delete"/> <Setter Property="MenuItem.Icon"> <Setter.Value> <Image Source="Resources/Delete.png"/> ...

cocoa + context sensitive menu on NSTableView with multiple rows selected

hi guys i am having a problem displaying context sensitive menu on control click on a tableview when multiple rows are selected. Its working fine when a single row is selected and then control clicked on it. The way i am implementing this is shown below: -(void)doSingleClick { NSLog(@"single clicked"); if([[NSApp currentE...

List box context menu

How do I add a context menu in a list box in MFC? I don't see any WM_CONTEXTMENU handler in list box's properties. Any ideas? EDIT: I followed this tutorial MFC List Control: How to use a context menu in a list control?. The tutorial says to derive my own class from CListBox which I did, but now how do I add list box of my derived class...

How to get system tray functionality WITHOUT using NotifyIcon.ContextMenu?

Hi, I'm trying to get my application to display a popup context menu when a user right-clicks on my notify icon in the system tray... but there's a twist. I'm aware that the NotifyIcon class I'm using to get the icon in the system tray has a ContextMenu property. I don't want to use that to get a right-click popup menu, because it ALWA...

Problems displaying a ContextMenu during the KeyDown event

I'm using the following code to display a context menu on my form when someone presses "Alt-A": private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Alt && e.KeyCode == Keys.A) { ContextMenuStrip menu = new ContextMenuStrip(); ToolStripMenuItem item = new ToolStripMenuItem("Hello &World"); i...

WPF ListBox drag & drop interferes with ContextMenu!?

I'm implementing drag & drop from a ListBox, but I'm seeing some strange behaviour with a ContextMenu elsewhere in the window. If you open the context menu and then start a drag from the ListBox, the context menu closes but won't open again until after you perform another drag. Does this make sense? Anybody got any ideas what might be...

Context Menus and NavigateTo in Blend / SketchFlow

Hi All, Hoping this will be a simple one, in Sketchflow i'm trying to wire up a context menu to navigate to another page. I've created the context menu, added a menu item, right clicked the mneu item in the Objects and Timeline panel and selected navigateto. When i run it, the menu comes up but when i click on the menu item it doesn't ...

WPF ContextMenu with ItemsSource - how to bind to Command in each item?

Hi, I have a collection of objects (viewmodels) that represent menu items. Each of them have a command that I would like to execute when a MenuItem is clicked. If I wanted to do the menu statically, I do it like this: <ContextMenu> <MenuItem Header="{Binding Text1}" Command={Binding Command1}> <MenuItem Header="{Binding Text2}"...

How to add a ContextMenu depending on which WPF DataGrid row is right-clicked?

I need to display different options in a ContextMenu depending on which row of a WPF DataGrid is right-clicked. My initial ideas were to accomplish this through either binding or handling a mouse click event, but I haven't had success with either strategy so far. Any help would be most appreciated! Thank you! Denise ...

"Sticky" MFC popup menu

I currently have some toolbar buttons with a small arrow on the side (TBSTYLE_EX_DRAWDDARROWS) that, when clicked, result in a popup context menu being displayed under the button. This is done by constructing a custom popup menu and calling TrackPopupMenu. The client now wants to be able to select multiple options from the menu before ...

GWT: context menu in RichTextArea

I'm using a RichTextArea in a GWT app. I want to add a context menu to my RichTextArea: public class MyRichTextArea extends RichTextArea implements HasContextMenuHandlers { public HandlerRegistration addContextMenuHandler(ContextMenuHandler h) { return addDomHandler(h, ContextMenuEvent.getType()); } } (...) myRichText...

PreviewMouseRightButtonUp does not fire when Context Menu is open

If I right-click on an Image I get the following events (shown in order): 1) MouseRightButtonDown 2) PreviewMouseRightButtonUp 3) MouseRightButtonUp At this point my Application displays a context menu. If that is open, and I right click on the image again I only get this event: 1) MouseRightButtonDown Nor sure what to do to get t...

Flex ContextMenu Change the items dynamically

Hi, I am using a ContextMenu for an AdvancedDataGrid in my application. I could implement the normal context menu for the grid. Now, I am planning to make the context menu dynamic. For example, if I click on a particular cell, I need to see only the items related to that cell in the Context Menu. Is there any way we can do that? ...

C# Mouse Right Click and Control Focus

I have a form which users can add controls to and when they right click it brings up a context menu which has an option to display the properties of the control they right clicked on. The problem I am having is trying to decide how to find out what control the user right clicks on since it could be any number of them and then giving tha...

Persisting a context menu after screen rotation

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

WPF ContextMenu Design. How to set Background in WPF MenuItem?

I create popup menu like this. <DockPanel.ContextMenu> <ContextMenu Background="#CD252220" Opacity="0.95" Foreground="LightGray" BorderBrush="DarkGray"> <MenuItem Header="_Save Image..." x:Name="btSave" IsEnabled="False" Click="btSave_Click" Style="{StaticResource MyStyle}"> <MenuItem.Icon> <Image...

How to add a Column ContextMenu in the WPF DataGrid

Hello, I'm trying to add a context menu to a column in the WPF datagrid and don't quite see how this is possible. I know how to add one to the datagrid, but I would like to have different menu items based on the column as well have the menu click event be aware of column or better yet the cell that the context menu was choosen for. My...