2019独角兽企业重金招聘Python工程师标准>>>

目标:完成一个简单的计算器的界面,暂时不做点击处理,主要联系UI布局。

步骤:

1、创建一个空的windows phone 项目;

2、打开mainPage.xaml文件,在布局文件中使用Grid布局,先分好区间,然后用Button填充对应的区间,完成后的编辑界面截图如下:

mainPage.xaml代码如下:

<Pagex:Class="App1.MainPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="using:App1"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"mc:Ignorable="d"Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"><Grid><Grid.RowDefinitions><RowDefinition Height="Auto"></RowDefinition><RowDefinition Height="*"></RowDefinition></Grid.RowDefinitions><StackPanel Grid.Row="0" Margin="19,0,0,0"><TextBlock Text="My Application" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,12,0,0"/><TextBlock Text="计算器" Style="{ThemeResource HeaderTextBlockStyle}" Margin="0,0,0,26.5" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}"/></StackPanel><Grid Grid.Row="1" x:Name="ContentRoot" Margin="19,9.5,19,0"><Grid.RowDefinitions><RowDefinition Height="80"/><RowDefinition Height="*"/></Grid.RowDefinitions><TextBlock Grid.Row="0" Height="80"/><Grid Grid.Row="1"><Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition/><ColumnDefinition/><ColumnDefinition/><ColumnDefinition/><ColumnDefinition/></Grid.ColumnDefinitions><Button Grid.Row="0" Grid.Column="0" Content="MC" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="0" Grid.Column="1" Content="MR" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="0" Grid.Column="2" Content="MS" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="0" Grid.Column="3" Content="M+" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="0" Grid.Column="4" Content="M-" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="1" Grid.Column="0" Content="←" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="1" Grid.Column="1" Content="CE" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="1" Grid.Column="2" Content="C" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="1" Grid.Column="3" Content="±" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="1" Grid.Column="4" Content="√" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="2" Grid.Column="0" Content="7" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="2" Grid.Column="1" Content="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="2" Grid.Column="2" Content="9" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="2" Grid.Column="3" Content="/" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="2" Grid.Column="4" Content="%" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="3" Grid.Column="0" Content="4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="3" Grid.Column="1" Content="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="3" Grid.Column="2" Content="6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="3" Grid.Column="3" Content="*" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="3" Grid.Column="4" Content="1/x" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="4" Grid.Column="0" Content="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="4" Grid.Column="1" Content="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="4" Grid.Column="2" Content="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="4" Grid.Column="3" Content="-" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="4" Grid.Column="4" Grid.RowSpan="2" Content="=" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Content="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="5" Grid.Column="2" Content="." HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/><Button Grid.Row="5" Grid.Column="3" Content="+" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="0" MinHeight="0" Padding="0" Margin="3,0"/></Grid></Grid></Grid>
</Page>

3、模拟器运行效果图:

转载于:https://my.oschina.net/caijunrong/blog/608230

Windows10 手机应用程序开发 - 3. 做一个简单的计算器界面相关推荐

  1. 用c++做一个简单的计算器

    用C++做一个简单的计算器 本教程的主要内容是如何使用C++做一个简单的计算器.它可以实现最基本的计算功能,提供5种计算方式. 全部代码如下: #include <iostream> // ...

  2. 杰理 AC692N系列 ---时钟闹钟开发流程 做一个简单的闹钟

    一.功能说明 时钟.闹钟在带显示的音箱上是比较常见的功能,但同时也是比较复杂的功能,它的难点主要在于操作和显示部分,因为不同的项目上会有不同的操作,显示也会有很大的差异,有些项目甚至于需要添加双闹钟的 ...

  3. php编写一个简单计算器程序,PHP做一个简单的计算器

    本文为大家讲解通过分支循环知识及PHP的表单处理一个简单的计算器 首先看下效果 通过网页显示计算器样式 在网页样式中可以看出,有两个输入框Num1.Num2和一个下拉框Type 还有一个提交按钮 在输 ...

  4. python 做一个简单的计算器

    python:做一个简易的计算器(加减乘除,重复使用) 第一种方法 def jisuanqi(): #实现加减乘除运算a, b, c=shuru()if c == "+":z = ...

  5. 使用python做一个简单的计算器

    今天教大家如何使用python撸一个简单的计算器小程序. 具体源码如下: import tkinter import math import tkinter.messageboxclass Calcu ...

  6. 使用tkinter做一个简单的计算器

    主要思路:将数字和运算符号都作为按钮展现,当点击按钮时,数字显示在输入框中,点击=号是对数字进行运算,将原来的数字删除,将运算结果展示在输入框中. 注意!当第一个数是0的时候将这个0从输入框中进行删除 ...

  7. 微信小程序入门项目-做一个马马虎虎的计算器

    效果: 打开微信开发者工具,新建小程序 打开app.json设置顶部的标题和颜色 由于小程序不支持JavaScript的一些函数,比如evel(),所以代码变得复杂很多. pages\index\in ...

  8. 用WinForm做一个简单的计算器

    首先创建一个界面将Button控件拖进来,修改好Text以及Name, 显示器用lable来做,将默认text和Tag属性设置为0,背景颜色BackColor可以根据自己喜好修改 数字0-9按钮名称B ...

  9. java 做计算器 百度云_用Java做一个简单的计算器

    窗体 package Calc; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * * 计算器程序6261 ...

最新文章

  1. 阿里架构师,讲述分布式架构云平台解决方案(附学习路线)...
  2. 用JS解决图片太大,把网站撑变形的问题
  3. [转]bootstrapTable refresh 方法使用简单举例
  4. python自带的url提取器
  5. coo_maxtrix保存到本地
  6. LeetCode 459. 重复的子字符串(数学)
  7. Ansible无敌详细入门教程
  8. java学到哪里最容易蒙,蒙哥比vs蒙克(目前最好的哪个)
  9. 「Luogu」[JSOI2007]字符加密 解题报告
  10. IIC 差异电平传输 和 IIC 地址
  11. 强中更有强中手:遇到CSDN比吾进步还快的博主
  12. Linux下重启tomcat
  13. 微型计算机原理与接口技术第六版,微型计算机原理与接口技术(第6版)
  14. 【海康威视】WPF客户端二次开发:【2】语音对讲
  15. 李永乐老师讲博弈论:帝王为啥要杀掉有功之臣
  16. ReviewBoard 系列图文教程之(一)—— 安装
  17. Android检测wifi信号强度,检测网络是否通畅
  18. usbos在服务器上不能引导,USBOS V3.0.2021.07.10
  19. 线上问题:nginx日志打印时间问题
  20. 【FPGA】VGA驱动:行同步时序+场同步时序

热门文章

  1. IPSEC非单播流量处理
  2. 一个路由再接另一个路由,让和别人合拉的一个网线可以多台电脑一起使用
  3. 活动目录实战系列七(降级主DC为成员服务器)
  4. 第六周---事后分析
  5. CoordinatorLayout使用全解析
  6. 51. 顺时针打印矩阵[print matrix in clockwise direction]
  7. 选择Asp for javascript,非.net。
  8. 推荐几本书,这些书.Net程序员最好要看
  9. 如何进行职业生涯规划
  10. xampp安装后apache(端口占用)/mysql无法打开(Attempting to start MySQL service...)/Mysql无法修改端口