menuitem

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

不想你离开。 提交于 2020-02-02 13:19:28
问题 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 Source="icons/save.png" Width="16" Height="16" Style="{StaticResource IconStyle}"/> </MenuItem.Icon> </MenuItem> </ContextMenu> </DockPanel.ContextMenu> Why left-side of this menu is WHITE????? It

Best way to set a MenuItem's sub-menu height?

不打扰是莪最后的温柔 提交于 2020-01-21 22:19:06
问题 I currently have a menuitem (part of a context menu), with about ~35 menu items. Because of this, it causes the sub-menu to be huge. Even though I have scrolling ability, I would like to set the height of this submenu while having the ability to still scroll. I've messed w/ the MenuItem.Itemspanel but have not been able to set the sub-menu's height and still scroll. 回答1: Unfortunately, WPF does not allow this to be modified by properties. You will have to modify the default ControlTemplate.

add menu item to default context menu

眉间皱痕 提交于 2020-01-20 03:26:27
问题 I'd like to add a menu item to the default ContextMenu of a RichTextBox . I could create a new context menu but then I lose the spell check suggestions that show up in the default menu. Is there a way to add an item without re-implementing everything? 回答1: It's not too tricky to reimplement the RichTextBox context menu with spelling suggestions, Cut, Paste, etc. Hook up the context menu opening event as follows: AddHandler(RichTextBox.ContextMenuOpeningEvent, new ContextMenuEventHandler

add menu item to default context menu

試著忘記壹切 提交于 2020-01-20 03:26:26
问题 I'd like to add a menu item to the default ContextMenu of a RichTextBox . I could create a new context menu but then I lose the spell check suggestions that show up in the default menu. Is there a way to add an item without re-implementing everything? 回答1: It's not too tricky to reimplement the RichTextBox context menu with spelling suggestions, Cut, Paste, etc. Hook up the context menu opening event as follows: AddHandler(RichTextBox.ContextMenuOpeningEvent, new ContextMenuEventHandler

WPF MenuItem style parameters not available on menu first open

末鹿安然 提交于 2020-01-17 03:49:25
问题 I am specifying a context menu within the ControlTemplate of a TreeViewItem as follows: <ContextMenu ItemsSource="{Binding Commands}"> <ContextMenu.ItemContainerStyle> <Style TargetType="MenuItem"> <Setter Property="Command" Value="{Binding Command}" /> <Setter Property="CommandParameter" Value="{Binding CommandParameter}" /> <Setter Property="Header" Value="{Binding Name}" /> <Setter Property="Icon" Value="{Binding Icon}" /> </Style> </ContextMenu.ItemContainerStyle> </ContextMenu> where

UIAutomator - How to click the menu item

穿精又带淫゛_ 提交于 2020-01-15 06:11:42
问题 I have automated go to setting in android phone using UI Automator and i clicked the menu using "getUiDevice().pressMenu();" and its opened menu with 3 sub menu item and i want to click the second menu by using name or index or id , please help how to click the sub menu in Android UIAutomator ? 回答1: This overflow menu icon ImageView with the three dots has no id ... but one can get it by it's description: UiObject2 menuButton = this.mDevice.findObject(By.desc("More options")); /* open the

UIAutomator - How to click the menu item

廉价感情. 提交于 2020-01-15 06:10:49
问题 I have automated go to setting in android phone using UI Automator and i clicked the menu using "getUiDevice().pressMenu();" and its opened menu with 3 sub menu item and i want to click the second menu by using name or index or id , please help how to click the sub menu in Android UIAutomator ? 回答1: This overflow menu icon ImageView with the three dots has no id ... but one can get it by it's description: UiObject2 menuButton = this.mDevice.findObject(By.desc("More options")); /* open the

How to set id for popup menu items, to be found as view id?

☆樱花仙子☆ 提交于 2020-01-14 10:08:26
问题 Background Out automatic tests use views' ids to be able to click on them, so we add ids whenever possible. The problem For popup menus, sometimes it's needed to populate them dynamically, but as I've found, even when I do add id for each item, the id isn't found, and can't be used. Even using DDMS's feature "dump view hierarchy for UI automator" shows that no view in the popup menu has an id. What I've tried This is a sample code of what I use, to try to set an id for the a single menu item.

Menu overflow 3dot not visible on some devices [closed]

☆樱花仙子☆ 提交于 2020-01-14 06:52:28
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Devices which have menu button on that overflow button not showing <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/incoming" android:showAsAction="always" android:title="Incoming Call Control"/> <item

Menu overflow 3dot not visible on some devices [closed]

*爱你&永不变心* 提交于 2020-01-14 06:52:11
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Devices which have menu button on that overflow button not showing <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/incoming" android:showAsAction="always" android:title="Incoming Call Control"/> <item