简体   繁体   中英

MenuItem.Icon VS 2015 hidden in Windows 10

I'm in charge of maintaining an application developed in VS 2015. The application looks great in Windows 7, but when run in Windows 10 the MenuItem.Icons shift down and to the right, so that only the top left corners show.

Windows 7

Windows 10

I've been playing with the padding and margins in xaml, but I'd like to figure out what is happening instead of just creating a work-around.

I'm new to Visual Studio. Maybe this will be obvious?

<Menu Name="MainMenu" Margin="0,128,0,12" HorizontalAlignment="Left" Width="172">
<MenuItem Header="Search" FontFamily="Shruti" FontSize="26" HorizontalAlignment="Center" Click="Search_Click" Cursor="Hand" x:Name="SearchMenu" IsTabStop="false" Height="55" Width="162" >
<MenuItem.Icon>
<Image Width="50" Height="50" Cursor="Hand" IsManipulationEnabled="True" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,0,0" >
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="Source" Value="/DomesticPartnership;component/Images/Search-Icon.gif"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Source" Value="/DomesticPartnership;component/Images/Search-Icon.png"/>
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</MenuItem.Icon>
</MenuItem>
</Menu>

In case anyone else runs into trouble with their icons in Win10:

I played with the margins and padding until I got the icons to show. It's not pretty, but the icons show in Win10 now.

Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM