Common xaml controls

常见的xaml控件:

先上一段代码,把他们基本都实现出来:

<Grid Name="MyGrid">

<Button Name="button"

Content="Button"

HorizontalAlignment="Left"

Margin="0,97,0,0"

Click="button_Click"

VerticalAlignment="Top"/>

<!--

这个一个简单的button控件,要讲的不多,

注意那个Click="button_Click"这句话定义了一个eventhandler,

可以选中button_Click然后右键转到定义去实现它。

-->

<TextBlock

FontSize="25"

Name="textBlock"

HorizontalAlignment="Left"

Margin="41,11,0,0"

TextWrapping="Wrap"

Text="TextBlock"

VerticalAlignment="Top"

Height="91"

Width="216"/>

<!--

输入的,而一个简单的textBlock的控件,没有什么可说的,

就是和textBox要区分开,textBox是负责输入的框,

而textBlock是负责显示文档的框。

-->

<TextBox Name="myTextBox"

HorizontalAlignment="Left"

Margin="0,172,0,0"

TextWrapping="Wrap"

Text="TextBox"

InputScope="Url"

VerticalAlignment="Top"

Width="109" Height="43"/>

<!--

刚刚已经说过这:textBox是负责输入的框,

而里面的InputScope="Url"这一点是用来设置当你输入时候的输入格式,

是26小键盘输入,还是数字输入,还是其他语种输入;

-->

<ComboBox Name="myComboBox"

HorizontalAlignment="Left"

Margin="0,231,0,0"

VerticalAlignment="Top"

Width="140"

Height="72"

RenderTransformOrigin="0.471,-0.237">

<ComboBoxItem Content="1" IsSelected="True"/>

<ComboBoxItem Content="2" />

<ComboBoxItem Content="3" />

<ComboBoxItem Content="4" />

<ComboBoxItem Content="5" />

<ComboBoxItem Content="6" />

</ComboBox>

<!--

ComboBox很有趣,它具有切换页面然后让你选泽的功能,

comboBox里面可以看到有很多comboBoxItem 这就是进入另一个页面待选的东西,

IsSelected表示默认选项。

-->

<CheckBox Name="myCheckBox"

Content="CheckBox"

HorizontalAlignment="Left"

Margin="222,162,0,0"

VerticalAlignment="Top"

Height="68" Width="77"/>

<!--

checkBox,就是一个勾选框。

-->

<RadioButton

Name="myFirstRadioButton"

Content="RadioButton1"

HorizontalAlignment="Left"

Margin="215,226,0,0"

VerticalAlignment="Top"

Height="56"

RenderTransformOrigin="0.5,0.5"

Width="93">

</RadioButton>

<RadioButton

Name="mySecondRadioButton"

Content="RadioButton2"

HorizontalAlignment="Left"

Margin="210,299,0,0"

VerticalAlignment="Top"

Height="60"

Width="34" RenderTransformOrigin="0.523,0.063"/>

<RadioButton

Name="myThirdRadioButton"

Content="RadioButton3"

HorizontalAlignment="Left"

Margin="210,375,0,0"

VerticalAlignment="Top"

Height="56"

RenderTransformOrigin="0.5,0.5"

Width="93"

GroupName="secondGroup"

>

</RadioButton>

<RadioButton

Name="myFourthRadioButton"

Content="RadioButton4"

HorizontalAlignment="Left"

Margin="210,450,0,0"

VerticalAlignment="Top"

Height="60"

GroupName="secondGroup"

Width="34"/>

<!--

RadioButton和checkButton差不多,也就是一个勾选栏,

然而是圆的,看起来好看,同时在功能上面,有个组的功能特别好,创建多个radioButton,

然后通过groupName不同来分组,从而达到每组只能选择一项,选择多项的功能。

-->

<DatePicker Name="myDatePicker"

HorizontalAlignment="Left"

Margin="0,305,0,0"

VerticalAlignment="Top"

/>

<!--

DatePicker这个控件就是一个显示时间的窗口

-->

<TimePicker

Name="myTimePicker"

HorizontalAlignment="Left"

Margin="0,394,0,0"

VerticalAlignment="Top"/>

<!--

timePicker这个控件就是显示具体时间的窗口

-->

<Image

Name="myImage"

Source="Assets/SmallLogo.scale-240.png"

HorizontalAlignment="Left"

Height="100"

Margin="222,358,0,0"

VerticalAlignment="Top"

Width="100"/>

<!--

image控件可以添加图片,我选的图片是Assets下的一些demo图片,

也没有学会其他加图片的方法,我将我的图片放到Assets目录下,

结果在vs解决问题资源管理器中没有显示,自然也就加载不了。这个很无奈,想学加图片

-->

<Slider

Name="mySliderControl"

HorizontalAlignment="Left"

Margin="40,482,0,0"

VerticalAlignment="Top"

Maximum="100"

Width="100"/>

<!--

slider就是一个滑条的感觉,Maximum是设置最大值的

-->

<ProgressBar

Name="myProgressBar"

HorizontalAlignment="Left"

Height="10"

Margin="41,544,0,0"

VerticalAlignment="Top"

Maximum="100"

Value="{Binding ElementName=mySliderControl,Path=Value,Mode=OneWay}"

Width="142"/>

<!--

ProgressBar是设置一个进度条,Maximum是设置进度条最大到达多少,

而Value="{Binding ElementName=mySliderControl,Path=Value,Mode=OneWay}"是指,

它bind了上面所建的slider的值。这个有待学习。

-->

<ProgressRing

Name="myProgressRing"

HorizontalAlignment="Left"

Margin="262,54,0,0"

VerticalAlignment="Top"/>

<!--

progressRing就是大家平时讨厌见到的转圈圈的progress。

-->

<ToggleButton

Name="myToggleButton"

Content="ToggleButton"

HorizontalAlignment="Left"

Click="myToggleButton_Click"

Margin="254,510,0,0"

VerticalAlignment="Top"/>

<!--

toggleButton也就一个特殊的button,我们来看一下它的eventhandler。

可以看到,就是一个可以记录自己是否被选中的button

-->

</Grid>

Common xaml controls(补交作业)的更多相关文章

  1. UWP作业(一)XAML Controls Gallery

    作为一个编程能力不是很好的uwp初学者,在控件库里看到种类繁多的选项时,需要查资料,最后决定出几种性能各方面可能不是那么出色的控件,内心也是非常纠结的.但当我把自己当成一个用户时,通过分析自己的需求, ...

  2. M2: XAML Controls

    本小节介绍如何在界面上添加简单的XAML Controls, 本例中我们用到了Grid, TextBlock, Button, 和StackPanel控件.XAML自身所有的控件都声明在Windows ...

  3. 求解: Windows Phone XAML Controls 为什么是disable状态?

    问题 : 我在做一个windows phone 的App,显示一个web 返回来的data,现在想用控件ListView 去绑定这个Data,但是 为何我的VS2012 中的 ToolBox 的XAM ...

  4. Xaml Controls Gallery 的五个没有用的控件

    HyperlinkButton 功能:这个控件可以实现点击按钮后跳到另一个按钮的功能. 我觉得这个功能有些多余,据我了解,一些深受欢迎的游戏大都具备的一个特点,那就是操作简单,界面中不会出现冗余的东西 ...

  5. Mycp补交作业

    Mycp补交作业 代码 import java.io.; import java.lang.; import java.util.Scanner; public class MyCP { public ...

  6. 对xaml的深入探究(补交作业)

    首先,下结论,看完那个外国老师的视频后,5%左右听懂了,分享给大家: 1.理解一下,xaml是特殊的xml,我们可以从代码语法看出,xaml中的打码很类似与html和xml的代码. 2.xaml.cs ...

  7. M2: XAML Controls(2)

    在前小节中,我们在Card程序的主界面中加入了简单的XAML控件, 本小节将在其基础上进行优化,使界面看上去更加美观.本小节用到了Grid Control, Border Control,以及XAML ...

  8. Event(补交作业)

    三种方法可以创建Eventhandler 1.

  9. Layout1:Grid(补交作业)

    Layout1:Grid 这一节我们来讲解一下一个layout:gird. 首先上一段代码: <Page x:Class="Gridstudy.MainPage" xmlns ...

随机推荐

  1. JS如何判断浏览器类型,如何模拟浏览器类型(模拟微信浏览器)

    一.前言 在编写前端代码时,为了页面兼容性,我们往往需要考虑不同的浏览器类型 而这就需要在前端代码中进行识别和区分 接下来就来谈谈对浏览器类型的识别 二.正文 (一).查看浏览器类型的核心代码 var ...

  2. transform.rotation和GetComponent<Rigidbody>().MoveRotation

    同时在UPDATE和FIXED UPDATE中调整 旋转 并未出现闪,而是一直以UPDATE中的为准,可认为MoveRotation调用后在UPDATE中生效 using System.Collect ...

  3. 最大正方形 · Maximal Square

    [抄题]: 在一个二维01矩阵中找到全为1的最大正方形 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 返回 4 [暴力解法]: 时间分析: 空间分析:i j 中保留一 ...

  4. jquery对象的遍历$(selector).each()

    <!DOCTYPE html> <html> <head> <script language="javascript" src=" ...

  5. Chrome 强制刷新缓存的方法

    https://jingyan.baidu.com/article/11c17a2c2a9e27f446e39d98.html

  6. [Selenium]对于某些对话框即有可能弹出来,也有可能不弹出来,这种应该怎么处理呢?

    界面上如果有一个对话框可能弹出来,也可能不弹出,我们都要认为是正常,应该怎么处理呢? /** * check if release notes dialog present * @author j * ...

  7. iOS Orientation获取

    [iOS Orientation获取] 1.[[UIDevice sharedInstance] orientation] 必须调用beginGeneratingDeviceOrientationNo ...

  8. Zookeeper基本使用(转)

    一.Zookeeper架构 云计算越来越流行的今天,单一机器处理能力已经不能满足我们的需求,不得不采用大量的服务集群.服务集群对外提供服务的过程中,有很多的配置需要随时更新,服务间需要协调工作,这些信 ...

  9. RECONSUME_LATER

    Failure consumption,later try to consume. ================MessageExt [queueId=0, storeSize=134, queu ...

  10. redis 设置认证

    server 使用帮助 [root@VM_7_88_centos src]# ./redis-server -h Usage: ./redis-server [/path/to/redis.conf] ...