|
I have a 'File' MenuItem were I would like to display a list of recently opened files.
Here is the xaml I have now:
<MenuItem Header="File}"> <MenuItem Header="Preferences..." Command="{Binding ShowOptionsViewCommand}" /> <Separator />...
Started by Julien Poulin on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
HookFileMenu() { m_Parent = Parent as MenuItem; if (m_Parent == null) { throw new InvalidOperationException = new MenuItem(); menuItem.DataContext = item; menuItem.Style = ItemContainerStyle at this SO answer for more details....
|
|
I have a simple WPF application with a menu. I need to add menu items dynamically at runtime. When I simply create a new menu item, and add it onto its parent MenuItem, it does not display in the menu, regardless of if UpdateLayout is called.
What must...
Answer Snippets (Read the full thread at stackoverflow):
Add to main menu MenuItem newMenuItem1 = new MenuItem(); newMenuItem1.Header = "Test 123"; this.MainMenu.Items.Add(newMenuItem1); //Add to a sub item MenuItem newMenuItem2 = new MenuItem) { // Create the ....
|
|
I am creating a contextmenu that should contain a listing of all folders, subfolders, and files in a chosen folder. I want the menu to open the files and folders when they are clicked, but the click event doesn't register if the menuitem has subitems....
Started by Erlend D. on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
This event is not raised.
If the MenuItems property for the MenuItem contains any items, this event is not raised.
|
Ask your Facebook Friends
|
I devised the following code for displaying a control's Tag property on mouseover. The code works fine for standard controls such as Labels and TextBoxes but I cannot get it to work for my MenuItems (more specifically ToolStripMenuItems). Could y'all ...
Started by Blu Dragon on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Aside: for readability, you might like to use the recursion set up for MenuItems....
In menuItem.MenuItems) { item Select += new EventHandler(menuItem_Select); if (item.IsParent your MenuItem-handling code won't do anything for them.
|
|
Hi,
I'm a newbie in C# bu I'm experienced Delphi developer. In Delphi I can use same code for MenuItem and ToolButton using TAction.OnExecute event and I can disable/enable MenuItem and ToolButton together using TAction.OnUpdate event. Is there a similar...
Answer Snippets (Read the full thread at stackoverflow):
Try ToolStripItemCommand() { controls = new List....
Event in C#?
You can hook the code for the MenuItem and the ToolButton in the same handler the MenuItem and the Button will execute the same code and provide the same functionality.
|
|
I have a statusItem application written in PyObjC. The statusItem has a menuItem which is supposed to launch a new window when it is clicked:
# Create statusItem statusItem = NSStatusBar.systemStatusBar().statusItemWithLength_(NSVariableStatusItemLength...
Started by DavidM on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In Objective-C this would be:
[NSApp activateIgnoringOtherApps:YES]; [[self window] makeKeyAndOrderFront:self];
I have no idea of PyObjC... .
You need to send the application an activateIgnoringOtherApps: message and then send the window makeKeyAndOrderFront: .
|
|
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...
Started by Stretch41 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The new item under the first-level TreeViewItem TreeViewItem tvi = myTree.ItemContainerGenerator.ContainerFromItem(myTree.Items[0]) as TreeViewItem; TreeViewItem newTerrainNode = new TreeViewItem.
|
|
The TextWrapping property of the TextBox has three possible values:
Wrap NoWrap WrapWithOverflow I would like to bind to the IsChecked property of a MenuItem. If the MenuItem is checked, I want to set the TextWrapping property of a TextBox to Wrap. If...
Started by Timothy Lee Russell on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The easiest solution would be to handle the CheckedChanged event of that menu item and adjust the wrap mode of... .
I don't think databinding will work here because the values are not of the same type (boolean vs enum) .
I assume you are talking about .NET.
|
|
Hi,
Im new on Android, and im trying to start an Activity from a MenuItem choose of the user.
Actually, im building my menu (and is working ok) from my main activity class using a MenuInflater:
@Override public boolean onCreateOptionsMenu(Menu menu) {...
Started by Josemalive on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I'm still quite new to android myself but don't you need to be passing a context to the Intent constructor?
protected void ShowScreenAddSite() { Intent i = new Intent(this, AddWebsite.class is not automatically referenced in the manifest....
|
|
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...
Started by patjbs on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
S = new Style(); var listMenuItems = new List<MenuItem>(); var mi = new MenuItem(); mi.Header}"> <TextBlock.ContextMenu> <ContextMenu> <MenuItem Header="Get Metadata" Name_Click(object sender....
|