menuitem

Java System Tray PopupMenu MenuItem with icons and variable fonts

和自甴很熟 提交于 2019-12-25 03:16:21
问题 As in the title, is there a way to do it? The introductory article is either misleading or not completed. 回答1: Fonts is not a problem so I'm not sure why that is part of the title. Icons is different. Check out the section from the Swing tutorial How to Use the System Tray. The tutorial explains the limitations and provides a link to a Bug Id which has some suggestions. I don't know if the suggestion work since I haven't tried them. 来源: https://stackoverflow.com/questions/5357713/java-system

Usage of GetOpenFileName() API in VC++ for opening a folder & NOT a file

人盡茶涼 提交于 2019-12-25 02:55:56
问题 BOOL WINAPI GetOpenFileName( Inout LPOPENFILENAME lpofn ); is used for opening a file in a VC++ program, say C:\Hello\World\abc.txt . But I want to use this function to select a folder C:\Hello\World instaed of a file in it. I guess I need to make some changes to the members of the structure "OPENFILENAME". Can anyone kindly lemme know how do I achieve this in a VC++ program. Thanks in advance. 回答1: GetOpenFileName does not support folder selection at all. Your options are: SHBrowseForFolder

How can code find resource in model that does not have access to user control

空扰寡人 提交于 2019-12-25 02:50:11
问题 I have a UserControl that has MergedDictionaries : <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="../LimitResources.xaml" /> <ResourceDictionary Source="../MenuItemTemplateResources.xaml" /> </ResourceDictionary.MergedDictionaries> ... </UserControl.Resources> in my Model a Menu is created. I want to access ControlTemplate declared in MenuItemTemplateResources.xaml. The ControlTemplate looks like this <ControlTemplate x:Key=

How can a MenuItem be separated into its own module in Electron?

左心房为你撑大大i 提交于 2019-12-25 02:15:10
问题 New to Electron and building menus I'm trying to see if I can separate a MenuItem to prevent an enormous file but I'm having issues. For example I've separated the menu code outside of main.js and I moved menu in a renderer directory within a Menu directory. I can call the Menu from main.js with: let mainMenu = Menu.buildFromTemplate(require('./renderer/Menus/mainMenu')) mainMenu.js : module.exports = [ { label: 'Foo', id: 'itemFoo', submenu: [ {label: 'Enter Foo'}, {label: 'Exit Foo'} ] }, {

Menu and submenus using binding with Icon

邮差的信 提交于 2019-12-25 00:46:11
问题 I using this solution in order to bind my Menu just like at this example and I wonder how can I add icon to my MenuItem . In my Model I also have property called IsSelected so I try this approach: <Menu.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type Menu:MenuItemViewModel}" ItemsSource="{Binding Path=MenuItems}"> <StackPanel Orientation="Horizontal"> <Image Source="pack://application:,,,/Resources/checked_lightslategray.ico" Width="12" Height="12" Margin="0,0,0,0"> <Image.Style>

How to create a multi-line options menu item (SubMenu)

我怕爱的太早我们不能终老 提交于 2019-12-24 19:28:23
问题 I have a really long title for MenuItem (Added as a SubMenu). When added to Action-bar the menu item spills over the screen. Even adding a "\n" in the title does not help. Is there a way to make the title appear in two lines? 回答1: You can create a custom layout for this type of menu. Here is an approach Android Action bar custom dropdown view on item click. 来源: https://stackoverflow.com/questions/20491243/how-to-create-a-multi-line-options-menu-item-submenu

Background of MenuItem won't change

孤街浪徒 提交于 2019-12-24 10:10:02
问题 I posted a similar question regarding my code compiling but I managed to get everything running. However, my code doesn't change the default white background to a darker color. Here is my code: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme"> <item name="@android:panelFullBackground">@android:color/background_dark</item> <item name="@android:panelColorBackground">@android:color/background_dark </item> <item name="@android:panelBackground">@android:color/background_dark<

Error : should use android:showAsAction when not using support library

送分小仙女□ 提交于 2019-12-24 02:55:08
问题 I'm using app compact support library v7 for providing support of lollipop in my app. I was able to make it work perfectly. When my actionbar not showing menu items as icon. I have followed this link to make it work . Following is my menu.xml : <menu xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/contact_add" android:icon="@drawable/ic_btn_add_contact" android:title="@string/add" app:showAsAction="always"

MenuItem blue on hover in xp, fine in windows 7

爷,独闯天下 提交于 2019-12-24 00:17:45
问题 Using XAML we've created a series of buttons at the bottom right of our application. They are in a DockPanel, which is in a Grid. They're just used as toggles, when clicked it changes to the other image. The problem occurs when you hover over the button in XP, the button completely turns to blue, you can't see the image...just blue. This works fine in win 7... <MenuItem Name="PhonePad_MenuItem" Background="{DynamicResource Audio_Btn_Dialer_Disabled_Brush}" Height="22" Width="22" Click=

How do you make height of context menu items not be fixed (ie scale to size of the particular item) in .Net?

馋奶兔 提交于 2019-12-23 12:32:30
问题 See the two images below. I don't want each item in the menu to be the height of the largest. It should size to fit the contents. I've played around with a number of properties and haven't been able to prevent this behavior. Is it possible? (source: blakerobertson.com) (source: blakerobertson.com) 回答1: Set MenuItem.OwnerDraw to true, then handle the MenuItem.MeasureItem event. This allows you to tell Windows Forms the size of this menu item independently of the size of others, albeit at the