• <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 平台中更改按钮样式

        Change button style in Universal Windows Platform(在通用 Windows 平台中更改按钮样式)

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  How delegates work (in the background)?(代表如何工作(在后台)?)
                  C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)
                      <tfoot id='m0s3o'></tfoot>
                          <bdo id='m0s3o'></bdo><ul id='m0s3o'></ul>

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

                        • <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>
                            <tbody id='m0s3o'></tbody>