• <small id='ZwVB5'></small><noframes id='ZwVB5'>

    <i id='ZwVB5'><tr id='ZwVB5'><dt id='ZwVB5'><q id='ZwVB5'><span id='ZwVB5'><b id='ZwVB5'><form id='ZwVB5'><ins id='ZwVB5'></ins><ul id='ZwVB5'></ul><sub id='ZwVB5'></sub></form><legend id='ZwVB5'></legend><bdo id='ZwVB5'><pre id='ZwVB5'><center id='ZwVB5'></center></pre></bdo></b><th id='ZwVB5'></th></span></q></dt></tr></i><div id='ZwVB5'><tfoot id='ZwVB5'></tfoot><dl id='ZwVB5'><fieldset id='ZwVB5'></fieldset></dl></div>
    <legend id='ZwVB5'><style id='ZwVB5'><dir id='ZwVB5'><q id='ZwVB5'></q></dir></style></legend>

        <bdo id='ZwVB5'></bdo><ul id='ZwVB5'></ul>

        <tfoot id='ZwVB5'></tfoot>
      1. 在通用 Windows 平台中更改按钮样式

        时间:2023-09-15

        <small id='TqMzE'></small><noframes id='TqMzE'>

            <tbody id='TqMzE'></tbody>
            <bdo id='TqMzE'></bdo><ul id='TqMzE'></ul>

              <tfoot id='TqMzE'></tfoot>
              <i id='TqMzE'><tr id='TqMzE'><dt id='TqMzE'><q id='TqMzE'><span id='TqMzE'><b id='TqMzE'><form id='TqMzE'><ins id='TqMzE'></ins><ul id='TqMzE'></ul><sub id='TqMzE'></sub></form><legend id='TqMzE'></legend><bdo id='TqMzE'><pre id='TqMzE'><center id='TqMzE'></center></pre></bdo></b><th id='TqMzE'></th></span></q></dt></tr></i><div id='TqMzE'><tfoot id='TqMzE'></tfoot><dl id='TqMzE'><fieldset id='TqMzE'></fieldset></dl></div>

                • <legend id='TqMzE'><style id='TqMzE'><dir id='TqMzE'><q id='TqMzE'></q></dir></style></legend>
                  本文介绍了在通用 Windows 平台中更改按钮样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我尝试制作一个简单的 C# UWP 应用程序,但当我的鼠标悬停在按钮上时,我不知道如何移除灰色背景.

                  我该怎么做?

                  (记住:它是适用于 Windows 10 平台的 UWP,而不是 Windows Phone 8.1 或 WPF)

                  解决方案

                  请按以下步骤操作:

                  1. 在解决方案资源管理器中单击鼠标右键并添加一个新项目ResourceDictionary"
                  2. 复制按钮的默认样式你可以在这个网页上找到它,你需要向下滚动一点:

                  如果您使用 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:

                  1. Rightclick in the Solution Explorer and add a new item of kind "ResourceDictionary"
                  2. Copy the Default Style of the Button you can find it on this webpage, you need to scroll down a little bit: Msdn

                  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.

                  1. Then add the style to your button like this: <Button Style="{StaticResource MyCustomButton}"></Button>
                  2. Last but not least go back to your ResourceDictionary and delete the following code lines you see in the Screenshot or comment it out like i did:

                  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 平台中更改按钮样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:C# 控制台获取 Windows 10 强调色 下一篇:我是否应该始终断开 Dispose 方法中的事件处理程序?

                  相关文章

                    <tfoot id='m0s3o'></tfoot>
                        <bdo id='m0s3o'></bdo><ul id='m0s3o'></ul>
                    1. <small id='m0s3o'></small><noframes id='m0s3o'>

                    2. <i id='m0s3o'><tr id='m0s3o'><dt id='m0s3o'><q id='m0s3o'><span id='m0s3o'><b id='m0s3o'><form id='m0s3o'><ins id='m0s3o'></ins><ul id='m0s3o'></ul><sub id='m0s3o'></sub></form><legend id='m0s3o'></legend><bdo id='m0s3o'><pre id='m0s3o'><center id='m0s3o'></center></pre></bdo></b><th id='m0s3o'></th></span></q></dt></tr></i><div id='m0s3o'><tfoot id='m0s3o'></tfoot><dl id='m0s3o'><fieldset id='m0s3o'></fieldset></dl></div>

                      <legend id='m0s3o'><style id='m0s3o'><dir id='m0s3o'><q id='m0s3o'></q></dir></style></legend>