contextmenu

Determining which ListViewItem was clicked on in a ListView when executing a ContextMenu MenuItem

I'm trying to use the context menu in a listview to run some code that requires data from which item it originated from. I initially just did this: XAML: <ListView x:Name="lvResources" ScrollViewer.VerticalScrollBarVisibility="Visible"> <ListView.Resources> <ContextMenu x:Key="resourceContextMenu"> <MenuI...

Can I control the context menu on a link in htmlText when using Flex?

I created a Flex application with a textArea. I'm populating the textArea's htmlText property. I have a context menu on the textArea, but I don't see how to make a different context menu when the user right clicks on a <a href...>link</a>. Can I control the context menu for a link displayed inside of the htmlText of a mx:TextArea? ...

c# separate context menu for listview header

How do i assign a separate context menu to the column headers of a listview in c#? ...

Show/Hide ContextMenuStrip outside the form

I'm creating a simple clipboard manager application. It monitors the content of a clipboard. When a change occurs (throu the win api message loop) it fires up a method to capture current content of clipboard and creates new object called clipboarditem. Next its building a ContextMeuStrip which consits of several clipboarditems created pr...

How to get MenuItem clicked events from TreeView ContextMenu

I am inserting TreeViewItems into a TreeView control and setting the style for each at the time of insertion. I am assigning different styles (predefined in XAML), depending on the type of node (TreeViewItem) I want to insert. Some of the styles include a ContextMenu. My problem is that I am unable to use Click="MyHandler" on the MenuI...

How to force binding evaluation every time a ContextMenu is opened ?

I have a ContextMenu with a MenuItem in it: <Grid> <Button Content="{Binding Test}"> <Button.ContextMenu> <ContextMenu> <StackPanel> <MenuItem Header="{Binding Test}"/> </StackPanel> </ContextMenu> </Button.ContextMenu> </Button> </Grid> ...

c# winforms context menu events problem

I added a context menu (add, cancel) to tree view dynamically. Now I want to show the selected tree node value when I click on context menu item click. How can I do that? ...

ContextMenu.StaysOpen Property (WPF)

Simple question here: what does the StaysOpen property of the ContextMenu (or equivalently Popup) control actually do? I have tried observing the difference in behaviour, but I notice none whatsoever. MSDN states the following: true if the menu should stay open until the IsOpen property changes to false; otherwise, false. The defau...

WPF : Suppress ContextMenu for ListView

I have a WPF ListView control with a ContextMenu written in XAML Code. With every right-click on the ListView the ContextMenu is shown even when there are no items in the ListView. This is a behavior I don't want. The ContextMenu should only open if there are items in the ListView. I have no problem counting the items but I don't find t...

Setting a WPF ContextMenu's PlacementTarget property in XAML?

<Button Name="btnFoo" Content="Foo" > <Button.ContextMenu Placement="Bottom" PlacementTarget="btnFoo"> <MenuItem Header="Bar" /> </Button.ContextMenu> </Button> gives me a runtime error 'UIElement' type does not have a public TypeConverter class I also tried <Button Name="btnFoo" Content="Foo" > <Button.ContextMen...

C# Contextmenu jumping if populated on Popup event

Hi I have a MenuItem that contains all files in a spesific folder. The menuitem is populated on its own Popup event (using System.IO.Directory.GetFiles), but if it is too close to the lower right corner of the screen (or so it seems), it will jump higher up on the screen while being populated. If I populate it before the Popup event i...

ContextMenu not displaying, and I don't know why

I'm writing a C# (.NET 3.5) app with a usercontrol that inherits from DataGridView. When the user right-clicks a column header, I want to display a context menu. I've actually got this working find on 2 forms in my app. I'm stumped because the ContextMenu won't show on the same control on a third form. I do see that the Popup event gets...

context menu parent?

Hi I added a context menu on label (c#, winforms). my context menu having 3 child items and i want to display label text when i click on any one of context menu items. thanks in advance ...

Entry in Shell Context Menu with Icon ?

Hi All, Seeing how Notepad++ does this, is it possible to achieve something like this: http://i28.tinypic.com/fm2gs6.png using Registry class? Pointers in the right direction would be highly appreciated. Have it working great without icon now. :) i31.tinypic.com/ekokgi.png I think registering icon is going to be harder. Thank...

ContextMenu Binding Source within a DataGrid using MVVM

I've got a datagrid column as below: <toolkit:DataGridTemplateColumn> <toolkit:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Path=LabelName}" Background="{Binding Path=Color}"> <TextBloc...

Actionscript 3 ContextMenu closed event?

There is an event which is dispatched when the context menu (right click menu) in actionscript for flash has been opened: ContextMenuEvent.MENU_SELECT Now, is there an event which is dispatched when the menu has been closed? ...

Get visual underlying ItemTemplate of an ItemsControl in ContextMenu.MenuItem.Click event handler?

Hello! First take a look at my code: <ListBox ItemsSource="{Binding}" SelectionMode="Multiple" ItemTemplate="{StaticResource ContactTemplate}"> <ListBox.ContextMenu> <ContextMenu> <MenuItem Name="mnuEdit" Header="_Edit" Click="MenuItem_Click" /> </ContextMenu> </ListBox.ContextMenu> </ListBox> ...

How can I display different ContextMenus in WPF ListView GridView?

I have a ListView GridView with ListViewItems that represent different categories of items. I'd like to display a different ContextMenu for each category of item. I was hoping to do this using DataTemplates but I'm struggling. My TreeView has a DataTemplate per category and I can see how I can set a different ContextMenu for each ther...

How to set ContextMenu of a bound item?

I am trying to achieve the following: <Style TargetType="ListBoxItem"> <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu> <MenuItem Name="mnuEdit" Header="_Edit" Click="MenuItem_Click" /> </ContextMenu> </Setter.Value> </Setter> <Style> But it throws the followi...

Context Menu for XAML Treeviewitem

In XAML, how do you define a context menu for treeviewitems that are distinguished by different attributes? ...