我尝试制作一个简单的 C# UWP 应用程序,但当我的鼠标悬停在按钮上时,我不知道如何移除灰色背景.
我该怎么做?
(记住:它是适用于 Windows 10 平台的 UWP,而不是 Windows Phone 8.1 或 WPF)
请按以下步骤操作:
如果您使用 Blend for Visual Studio 有一个更简单的解决方案,您可以更快地编辑这些内容,但要保持结构并学习它,上面的解决方案是更好的解决方案.
I've tried to make a simple C# UWP application and I don't know how to remove the gray background when my mouse is over the button.
How I do that?
(remember: it's an UWP for Windows 10 platform , not Windows Phone 8.1 or WPF)
Follow these steps:
Then insert it in your ResourceDictionary.xaml format should look like this:
<ResourceDictionary><Style></Style></ResourceDictionary>
3. Give the Style a key like this:
<Style x:Key="MyCustomButton"></Style>
4. Go to App.xaml edit it by adding the Resource Dictionary like this:
<Application.Resources>
<ResourceDictionary Source="Resources.xaml"></ResourceDictionary>
</Application.Resources>
The Source of the ResourceDictionary is the Name of your ResourceDictionary file.
<Button Style="{StaticResource MyCustomButton}"></Button>
There is a more easy solution if you use Blend for Visual Studio there you can edit this stuff more quickly but to keep the structure and for learning it the solution above is the better one.
这篇关于在通用 Windows 平台中更改按钮样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!