简体   繁体   English

如何使用XAML在Windows Phone应用程序中创建加号或减号按钮?

[英]How do I create a plus or minus button in my Windows Phone app using XAML?

I want to include a plus or minus button in my Windows Phone app. 我想在Windows Phone应用程序中包含加号或减号按钮。 How can I change the content of the button to plus or minus? 如何将按钮的内容更改为加号或减号?

<Button x:Name="buttonPlusOrMinus" 
            Content="+/-"
            HorizontalAlignment="Left" 
            Margin="180,217,0,0" 
            Grid.Row="2" 
            VerticalAlignment="Top"/>

There is a few ways to do this. 有几种方法可以做到这一点。

  • Hold down the Alt key then type 0177 on the numpad and let go of Alt , this will cause you to type ±. 按住Alt键,然后在数字键盘上键入0177并放开Alt ,这将导致您键入±。

  • Open up the program charmap in windows, find the character you are looking for, then click the "Select" then the "Copy" button. 在Windows中打开程序charmap ,找到所需的字符,然后单击“选择”,然后单击“复制”按钮。 You will then be able to paste the ± character in your code. 然后,您将能够在代码中粘贴±字符。

在此处输入图片说明

  • Copy the ± character from this question into your code. 将这个问题的±字符复制到您的代码中。

     <Button x:Name="buttonPlusOrMinus" Content="±" HorizontalAlignment="Left" Margin="180,217,0,0" Grid.Row="2" VerticalAlignment="Top"/> 

Windows 8 Dev Icons, Windows store app is the best app to meet all your requirements. Windows 8开发者图标,Windows应用商店应用程序是满足您所有需求的最佳应用程序。 You can simply copy and paste to make a + or - button as you want. 您可以根据需要简单地复制和粘贴以制作+或-按钮。 https://www.microsoft.com/en-us/store/apps/windows-8-dev-icons/9wzdncrdqhbv https://www.microsoft.com/zh-cn/store/apps/windows-8-dev-icons/9wzdncrdqhbv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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