翼度科技»论坛 编程开发 .net 查看内容

WPF学习笔记05-控件Control_Part2

6

主题

6

帖子

18

积分

新手上路

Rank: 1

积分
18
1 - 文本控件<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>我们熟悉的文本控件不外乎TextBox,RichTextBox。在WPF中还有一个PasswordBox,不过区分于前者的区别就是PasswordBox是直接继承于Control的比较特殊,前三者是继承于TextBoxBase的。接下来我们就简单介绍下这几个控件。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>1.1 - 多行文本<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>对于TextBox而言通常用于存储单行文本的并且能够通过MaxLength属性来设置字符的数量的,但是有时候我们需要大量的文本内容。这时候我们能够将TextWarpping属性设置为Wrap或者WrapOverflow。如果是前者,会在控件边缘直接换行。如果后者到了该换行的时候如果没有发现合适位置换行会允许拉伸某些行超过右侧边缘的。这是两者区别。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>同时MaxLines和MinLines是设置最大行数和最小行数的。如果我们设置完最大行之后对应内容不够显示的时候我们可以设置VerticalScrollBarVisibility设置为Auto。此时滚动条也就直接能够显示出来。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>直接贴图片吧
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>1.2 - PasswordBox<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>直接继承于Control的类。通过字符屏蔽实际字符(通过PasswordChar设置字符如*○等)且不支持复制<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
  1. [/code][size=6]2 - 列表控件[/size]<Label Content="设置Delay" />
  2. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  3. <Label Content="设置Interval" />
  4. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  5. <Label Content="当前值" />
  6. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  7. <p><Slider<br>
  8. x:Name="t"<br>
  9. Width="200"<br>
  10. Height="200"<br>
  11. Margin="0,30"<br>
  12. Maximum="1000"<br>
  13. Minimum="1"<br>
  14. Orientation="Horizontal" /></p><Label Content="设置Delay" />
  15. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  16. <Label Content="设置Interval" />
  17. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  18. <Label Content="当前值" />
  19. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  20. <p><Slider<br>
  21. x:Name="t"<br>
  22. Width="200"<br>
  23. Height="200"<br>
  24. Margin="0,30"<br>
  25. Maximum="1000"<br>
  26. Minimum="1"<br>
  27. Orientation="Horizontal" /></p>简单介绍下ListBox和ComboBox的使用。都继承自ItemsControl类。Itemcontrol类添加了所有基于列表的控件都使用的基本功能。<Label Content="设置Delay" />
  28. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  29. <Label Content="设置Interval" />
  30. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  31. <Label Content="当前值" />
  32. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  33. <p><Slider<br>
  34. x:Name="t"<br>
  35. Width="200"<br>
  36. Height="200"<br>
  37. Margin="0,30"<br>
  38. Maximum="1000"<br>
  39. Minimum="1"<br>
  40. Orientation="Horizontal" /></p>[size=5]2.1 ListBox[/size]<Label Content="设置Delay" />
  41. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  42. <Label Content="设置Interval" />
  43. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  44. <Label Content="当前值" />
  45. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  46. <p><Slider<br>
  47. x:Name="t"<br>
  48. Width="200"<br>
  49. Height="200"<br>
  50. Margin="0,30"<br>
  51. Maximum="1000"<br>
  52. Minimum="1"<br>
  53. Orientation="Horizontal" /></p><Label Content="设置Delay" />
  54. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  55. <Label Content="设置Interval" />
  56. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  57. <Label Content="当前值" />
  58. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  59. <p><Slider<br>
  60. x:Name="t"<br>
  61. Width="200"<br>
  62. Height="200"<br>
  63. Margin="0,30"<br>
  64. Maximum="1000"<br>
  65. Minimum="1"<br>
  66. Orientation="Horizontal" /></p>简单的ListBox示例<Label Content="设置Delay" />
  67. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  68. <Label Content="设置Interval" />
  69. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  70. <Label Content="当前值" />
  71. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  72. <p><Slider<br>
  73. x:Name="t"<br>
  74. Width="200"<br>
  75. Height="200"<br>
  76. Margin="0,30"<br>
  77. Maximum="1000"<br>
  78. Minimum="1"<br>
  79. Orientation="Horizontal" /></p>[code]<ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  80. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  81. <Label Content="设置Interval" />
  82. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  83. <Label Content="当前值" />
  84. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  85. <p><Slider<br>
  86. x:Name="t"<br>
  87. Width="200"<br>
  88. Height="200"<br>
  89. Margin="0,30"<br>
  90. Maximum="1000"<br>
  91. Minimum="1"<br>
  92. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  93. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  94. <Label Content="设置Interval" />
  95. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  96. <Label Content="当前值" />
  97. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  98. <p><Slider<br>
  99. x:Name="t"<br>
  100. Width="200"<br>
  101. Height="200"<br>
  102. Margin="0,30"<br>
  103. Maximum="1000"<br>
  104. Minimum="1"<br>
  105. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  106. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  107. <Label Content="设置Interval" />
  108. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  109. <Label Content="当前值" />
  110. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  111. <p><Slider<br>
  112. x:Name="t"<br>
  113. Width="200"<br>
  114. Height="200"<br>
  115. Margin="0,30"<br>
  116. Maximum="1000"<br>
  117. Minimum="1"<br>
  118. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  119. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  120. <Label Content="设置Interval" />
  121. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  122. <Label Content="当前值" />
  123. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  124. <p><Slider<br>
  125. x:Name="t"<br>
  126. Width="200"<br>
  127. Height="200"<br>
  128. Margin="0,30"<br>
  129. Maximum="1000"<br>
  130. Minimum="1"<br>
  131. Orientation="Horizontal" /></p></ListBox>
复制代码
其中ListBoxItem不仅仅只支持文本同样跟其他设置content一样可以多元化设置比如:<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
  1. <ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  2. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  3. <Label Content="设置Interval" />
  4. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  5. <Label Content="当前值" />
  6. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  7. <p><Slider<br>
  8. x:Name="t"<br>
  9. Width="200"<br>
  10. Height="200"<br>
  11. Margin="0,30"<br>
  12. Maximum="1000"<br>
  13. Minimum="1"<br>
  14. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  15. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  16. <Label Content="设置Interval" />
  17. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  18. <Label Content="当前值" />
  19. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  20. <p><Slider<br>
  21. x:Name="t"<br>
  22. Width="200"<br>
  23. Height="200"<br>
  24. Margin="0,30"<br>
  25. Maximum="1000"<br>
  26. Minimum="1"<br>
  27. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  28. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  29. <Label Content="设置Interval" />
  30. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  31. <Label Content="当前值" />
  32. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  33. <p><Slider<br>
  34. x:Name="t"<br>
  35. Width="200"<br>
  36. Height="200"<br>
  37. Margin="0,30"<br>
  38. Maximum="1000"<br>
  39. Minimum="1"<br>
  40. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  41. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  42. <Label Content="设置Interval" />
  43. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  44. <Label Content="当前值" />
  45. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  46. <p><Slider<br>
  47. x:Name="t"<br>
  48. Width="200"<br>
  49. Height="200"<br>
  50. Margin="0,30"<br>
  51. Maximum="1000"<br>
  52. Minimum="1"<br>
  53. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  54. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  55. <Label Content="设置Interval" />
  56. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  57. <Label Content="当前值" />
  58. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  59. <p><Slider<br>
  60. x:Name="t"<br>
  61. Width="200"<br>
  62. Height="200"<br>
  63. Margin="0,30"<br>
  64. Maximum="1000"<br>
  65. Minimum="1"<br>
  66. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  67. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  68. <Label Content="设置Interval" />
  69. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  70. <Label Content="当前值" />
  71. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  72. <p><Slider<br>
  73. x:Name="t"<br>
  74. Width="200"<br>
  75. Height="200"<br>
  76. Margin="0,30"<br>
  77. Maximum="1000"<br>
  78. Minimum="1"<br>
  79. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  80. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  81. <Label Content="设置Interval" />
  82. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  83. <Label Content="当前值" />
  84. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  85. <p><Slider<br>
  86. x:Name="t"<br>
  87. Width="200"<br>
  88. Height="200"<br>
  89. Margin="0,30"<br>
  90. Maximum="1000"<br>
  91. Minimum="1"<br>
  92. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  93. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  94. <Label Content="设置Interval" />
  95. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  96. <Label Content="当前值" />
  97. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  98. <p><Slider<br>
  99. x:Name="t"<br>
  100. Width="200"<br>
  101. Height="200"<br>
  102. Margin="0,30"<br>
  103. Maximum="1000"<br>
  104. Minimum="1"<br>
  105. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  106. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  107. <Label Content="设置Interval" />
  108. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  109. <Label Content="当前值" />
  110. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  111. <p><Slider<br>
  112. x:Name="t"<br>
  113. Width="200"<br>
  114. Height="200"<br>
  115. Margin="0,30"<br>
  116. Maximum="1000"<br>
  117. Minimum="1"<br>
  118. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  119. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  120. <Label Content="设置Interval" />
  121. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  122. <Label Content="当前值" />
  123. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  124. <p><Slider<br>
  125. x:Name="t"<br>
  126. Width="200"<br>
  127. Height="200"<br>
  128. Margin="0,30"<br>
  129. Maximum="1000"<br>
  130. Minimum="1"<br>
  131. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  132. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  133. <Label Content="设置Interval" />
  134. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  135. <Label Content="当前值" />
  136. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  137. <p><Slider<br>
  138. x:Name="t"<br>
  139. Width="200"<br>
  140. Height="200"<br>
  141. Margin="0,30"<br>
  142. Maximum="1000"<br>
  143. Minimum="1"<br>
  144. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  145. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  146. <Label Content="设置Interval" />
  147. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  148. <Label Content="当前值" />
  149. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  150. <p><Slider<br>
  151. x:Name="t"<br>
  152. Width="200"<br>
  153. Height="200"<br>
  154. Margin="0,30"<br>
  155. Maximum="1000"<br>
  156. Minimum="1"<br>
  157. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  158. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  159. <Label Content="设置Interval" />
  160. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  161. <Label Content="当前值" />
  162. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  163. <p><Slider<br>
  164. x:Name="t"<br>
  165. Width="200"<br>
  166. Height="200"<br>
  167. Margin="0,30"<br>
  168. Maximum="1000"<br>
  169. Minimum="1"<br>
  170. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  171. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  172. <Label Content="设置Interval" />
  173. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  174. <Label Content="当前值" />
  175. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  176. <p><Slider<br>
  177. x:Name="t"<br>
  178. Width="200"<br>
  179. Height="200"<br>
  180. Margin="0,30"<br>
  181. Maximum="1000"<br>
  182. Minimum="1"<br>
  183. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  184. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  185. <Label Content="设置Interval" />
  186. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  187. <Label Content="当前值" />
  188. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  189. <p><Slider<br>
  190. x:Name="t"<br>
  191. Width="200"<br>
  192. Height="200"<br>
  193. Margin="0,30"<br>
  194. Maximum="1000"<br>
  195. Minimum="1"<br>
  196. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  197. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  198. <Label Content="设置Interval" />
  199. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  200. <Label Content="当前值" />
  201. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  202. <p><Slider<br>
  203. x:Name="t"<br>
  204. Width="200"<br>
  205. Height="200"<br>
  206. Margin="0,30"<br>
  207. Maximum="1000"<br>
  208. Minimum="1"<br>
  209. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  210. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  211. <Label Content="设置Interval" />
  212. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  213. <Label Content="当前值" />
  214. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  215. <p><Slider<br>
  216. x:Name="t"<br>
  217. Width="200"<br>
  218. Height="200"<br>
  219. Margin="0,30"<br>
  220. Maximum="1000"<br>
  221. Minimum="1"<br>
  222. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  223. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  224. <Label Content="设置Interval" />
  225. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  226. <Label Content="当前值" />
  227. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  228. <p><Slider<br>
  229. x:Name="t"<br>
  230. Width="200"<br>
  231. Height="200"<br>
  232. Margin="0,30"<br>
  233. Maximum="1000"<br>
  234. Minimum="1"<br>
  235. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  236. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  237. <Label Content="设置Interval" />
  238. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  239. <Label Content="当前值" />
  240. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  241. <p><Slider<br>
  242. x:Name="t"<br>
  243. Width="200"<br>
  244. Height="200"<br>
  245. Margin="0,30"<br>
  246. Maximum="1000"<br>
  247. Minimum="1"<br>
  248. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  249. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  250. <Label Content="设置Interval" />
  251. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  252. <Label Content="当前值" />
  253. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  254. <p><Slider<br>
  255. x:Name="t"<br>
  256. Width="200"<br>
  257. Height="200"<br>
  258. Margin="0,30"<br>
  259. Maximum="1000"<br>
  260. Minimum="1"<br>
  261. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  262. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  263. <Label Content="设置Interval" />
  264. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  265. <Label Content="当前值" />
  266. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  267. <p><Slider<br>
  268. x:Name="t"<br>
  269. Width="200"<br>
  270. Height="200"<br>
  271. Margin="0,30"<br>
  272. Maximum="1000"<br>
  273. Minimum="1"<br>
  274. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  275. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  276. <Label Content="设置Interval" />
  277. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  278. <Label Content="当前值" />
  279. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  280. <p><Slider<br>
  281. x:Name="t"<br>
  282. Width="200"<br>
  283. Height="200"<br>
  284. Margin="0,30"<br>
  285. Maximum="1000"<br>
  286. Minimum="1"<br>
  287. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  288. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  289. <Label Content="设置Interval" />
  290. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  291. <Label Content="当前值" />
  292. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  293. <p><Slider<br>
  294. x:Name="t"<br>
  295. Width="200"<br>
  296. Height="200"<br>
  297. Margin="0,30"<br>
  298. Maximum="1000"<br>
  299. Minimum="1"<br>
  300. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  301. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  302. <Label Content="设置Interval" />
  303. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  304. <Label Content="当前值" />
  305. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  306. <p><Slider<br>
  307. x:Name="t"<br>
  308. Width="200"<br>
  309. Height="200"<br>
  310. Margin="0,30"<br>
  311. Maximum="1000"<br>
  312. Minimum="1"<br>
  313. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  314. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  315. <Label Content="设置Interval" />
  316. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  317. <Label Content="当前值" />
  318. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  319. <p><Slider<br>
  320. x:Name="t"<br>
  321. Width="200"<br>
  322. Height="200"<br>
  323. Margin="0,30"<br>
  324. Maximum="1000"<br>
  325. Minimum="1"<br>
  326. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  327. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  328. <Label Content="设置Interval" />
  329. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  330. <Label Content="当前值" />
  331. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  332. <p><Slider<br>
  333. x:Name="t"<br>
  334. Width="200"<br>
  335. Height="200"<br>
  336. Margin="0,30"<br>
  337. Maximum="1000"<br>
  338. Minimum="1"<br>
  339. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  340. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  341. <Label Content="设置Interval" />
  342. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  343. <Label Content="当前值" />
  344. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  345. <p><Slider<br>
  346. x:Name="t"<br>
  347. Width="200"<br>
  348. Height="200"<br>
  349. Margin="0,30"<br>
  350. Maximum="1000"<br>
  351. Minimum="1"<br>
  352. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  353. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  354. <Label Content="设置Interval" />
  355. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  356. <Label Content="当前值" />
  357. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  358. <p><Slider<br>
  359. x:Name="t"<br>
  360. Width="200"<br>
  361. Height="200"<br>
  362. Margin="0,30"<br>
  363. Maximum="1000"<br>
  364. Minimum="1"<br>
  365. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  366. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  367. <Label Content="设置Interval" />
  368. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  369. <Label Content="当前值" />
  370. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  371. <p><Slider<br>
  372. x:Name="t"<br>
  373. Width="200"<br>
  374. Height="200"<br>
  375. Margin="0,30"<br>
  376. Maximum="1000"<br>
  377. Minimum="1"<br>
  378. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  379. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  380. <Label Content="设置Interval" />
  381. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  382. <Label Content="当前值" />
  383. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  384. <p><Slider<br>
  385. x:Name="t"<br>
  386. Width="200"<br>
  387. Height="200"<br>
  388. Margin="0,30"<br>
  389. Maximum="1000"<br>
  390. Minimum="1"<br>
  391. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  392. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  393. <Label Content="设置Interval" />
  394. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  395. <Label Content="当前值" />
  396. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  397. <p><Slider<br>
  398. x:Name="t"<br>
  399. Width="200"<br>
  400. Height="200"<br>
  401. Margin="0,30"<br>
  402. Maximum="1000"<br>
  403. Minimum="1"<br>
  404. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  405. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  406. <Label Content="设置Interval" />
  407. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  408. <Label Content="当前值" />
  409. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  410. <p><Slider<br>
  411. x:Name="t"<br>
  412. Width="200"<br>
  413. Height="200"<br>
  414. Margin="0,30"<br>
  415. Maximum="1000"<br>
  416. Minimum="1"<br>
  417. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  418. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  419. <Label Content="设置Interval" />
  420. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  421. <Label Content="当前值" />
  422. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  423. <p><Slider<br>
  424. x:Name="t"<br>
  425. Width="200"<br>
  426. Height="200"<br>
  427. Margin="0,30"<br>
  428. Maximum="1000"<br>
  429. Minimum="1"<br>
  430. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  431. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  432. <Label Content="设置Interval" />
  433. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  434. <Label Content="当前值" />
  435. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  436. <p><Slider<br>
  437. x:Name="t"<br>
  438. Width="200"<br>
  439. Height="200"<br>
  440. Margin="0,30"<br>
  441. Maximum="1000"<br>
  442. Minimum="1"<br>
  443. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  444. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  445. <Label Content="设置Interval" />
  446. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  447. <Label Content="当前值" />
  448. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  449. <p><Slider<br>
  450. x:Name="t"<br>
  451. Width="200"<br>
  452. Height="200"<br>
  453. Margin="0,30"<br>
  454. Maximum="1000"<br>
  455. Minimum="1"<br>
  456. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  457. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  458. <Label Content="设置Interval" />
  459. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  460. <Label Content="当前值" />
  461. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  462. <p><Slider<br>
  463. x:Name="t"<br>
  464. Width="200"<br>
  465. Height="200"<br>
  466. Margin="0,30"<br>
  467. Maximum="1000"<br>
  468. Minimum="1"<br>
  469. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  470. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  471. <Label Content="设置Interval" />
  472. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  473. <Label Content="当前值" />
  474. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  475. <p><Slider<br>
  476. x:Name="t"<br>
  477. Width="200"<br>
  478. Height="200"<br>
  479. Margin="0,30"<br>
  480. Maximum="1000"<br>
  481. Minimum="1"<br>
  482. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  483. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  484. <Label Content="设置Interval" />
  485. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  486. <Label Content="当前值" />
  487. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  488. <p><Slider<br>
  489. x:Name="t"<br>
  490. Width="200"<br>
  491. Height="200"<br>
  492. Margin="0,30"<br>
  493. Maximum="1000"<br>
  494. Minimum="1"<br>
  495. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  496. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  497. <Label Content="设置Interval" />
  498. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  499. <Label Content="当前值" />
  500. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  501. <p><Slider<br>
  502. x:Name="t"<br>
  503. Width="200"<br>
  504. Height="200"<br>
  505. Margin="0,30"<br>
  506. Maximum="1000"<br>
  507. Minimum="1"<br>
  508. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  509. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  510. <Label Content="设置Interval" />
  511. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  512. <Label Content="当前值" />
  513. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  514. <p><Slider<br>
  515. x:Name="t"<br>
  516. Width="200"<br>
  517. Height="200"<br>
  518. Margin="0,30"<br>
  519. Maximum="1000"<br>
  520. Minimum="1"<br>
  521. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  522. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  523. <Label Content="设置Interval" />
  524. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  525. <Label Content="当前值" />
  526. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  527. <p><Slider<br>
  528. x:Name="t"<br>
  529. Width="200"<br>
  530. Height="200"<br>
  531. Margin="0,30"<br>
  532. Maximum="1000"<br>
  533. Minimum="1"<br>
  534. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  535. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  536. <Label Content="设置Interval" />
  537. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  538. <Label Content="当前值" />
  539. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  540. <p><Slider<br>
  541. x:Name="t"<br>
  542. Width="200"<br>
  543. Height="200"<br>
  544. Margin="0,30"<br>
  545. Maximum="1000"<br>
  546. Minimum="1"<br>
  547. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  548. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  549. <Label Content="设置Interval" />
  550. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  551. <Label Content="当前值" />
  552. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  553. <p><Slider<br>
  554. x:Name="t"<br>
  555. Width="200"<br>
  556. Height="200"<br>
  557. Margin="0,30"<br>
  558. Maximum="1000"<br>
  559. Minimum="1"<br>
  560. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  561. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  562. <Label Content="设置Interval" />
  563. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  564. <Label Content="当前值" />
  565. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  566. <p><Slider<br>
  567. x:Name="t"<br>
  568. Width="200"<br>
  569. Height="200"<br>
  570. Margin="0,30"<br>
  571. Maximum="1000"<br>
  572. Minimum="1"<br>
  573. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  574. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  575. <Label Content="设置Interval" />
  576. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  577. <Label Content="当前值" />
  578. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  579. <p><Slider<br>
  580. x:Name="t"<br>
  581. Width="200"<br>
  582. Height="200"<br>
  583. Margin="0,30"<br>
  584. Maximum="1000"<br>
  585. Minimum="1"<br>
  586. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  587. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  588. <Label Content="设置Interval" />
  589. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  590. <Label Content="当前值" />
  591. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  592. <p><Slider<br>
  593. x:Name="t"<br>
  594. Width="200"<br>
  595. Height="200"<br>
  596. Margin="0,30"<br>
  597. Maximum="1000"<br>
  598. Minimum="1"<br>
  599. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  600. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  601. <Label Content="设置Interval" />
  602. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  603. <Label Content="当前值" />
  604. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  605. <p><Slider<br>
  606. x:Name="t"<br>
  607. Width="200"<br>
  608. Height="200"<br>
  609. Margin="0,30"<br>
  610. Maximum="1000"<br>
  611. Minimum="1"<br>
  612. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  613. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  614. <Label Content="设置Interval" />
  615. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  616. <Label Content="当前值" />
  617. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  618. <p><Slider<br>
  619. x:Name="t"<br>
  620. Width="200"<br>
  621. Height="200"<br>
  622. Margin="0,30"<br>
  623. Maximum="1000"<br>
  624. Minimum="1"<br>
  625. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  626. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  627. <Label Content="设置Interval" />
  628. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  629. <Label Content="当前值" />
  630. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  631. <p><Slider<br>
  632. x:Name="t"<br>
  633. Width="200"<br>
  634. Height="200"<br>
  635. Margin="0,30"<br>
  636. Maximum="1000"<br>
  637. Minimum="1"<br>
  638. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  639. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  640. <Label Content="设置Interval" />
  641. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  642. <Label Content="当前值" />
  643. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  644. <p><Slider<br>
  645. x:Name="t"<br>
  646. Width="200"<br>
  647. Height="200"<br>
  648. Margin="0,30"<br>
  649. Maximum="1000"<br>
  650. Minimum="1"<br>
  651. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  652. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  653. <Label Content="设置Interval" />
  654. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  655. <Label Content="当前值" />
  656. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  657. <p><Slider<br>
  658. x:Name="t"<br>
  659. Width="200"<br>
  660. Height="200"<br>
  661. Margin="0,30"<br>
  662. Maximum="1000"<br>
  663. Minimum="1"<br>
  664. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  665. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  666. <Label Content="设置Interval" />
  667. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  668. <Label Content="当前值" />
  669. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  670. <p><Slider<br>
  671. x:Name="t"<br>
  672. Width="200"<br>
  673. Height="200"<br>
  674. Margin="0,30"<br>
  675. Maximum="1000"<br>
  676. Minimum="1"<br>
  677. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  678. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  679. <Label Content="设置Interval" />
  680. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  681. <Label Content="当前值" />
  682. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  683. <p><Slider<br>
  684. x:Name="t"<br>
  685. Width="200"<br>
  686. Height="200"<br>
  687. Margin="0,30"<br>
  688. Maximum="1000"<br>
  689. Minimum="1"<br>
  690. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  691. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  692. <Label Content="设置Interval" />
  693. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  694. <Label Content="当前值" />
  695. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  696. <p><Slider<br>
  697. x:Name="t"<br>
  698. Width="200"<br>
  699. Height="200"<br>
  700. Margin="0,30"<br>
  701. Maximum="1000"<br>
  702. Minimum="1"<br>
  703. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  704. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  705. <Label Content="设置Interval" />
  706. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  707. <Label Content="当前值" />
  708. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  709. <p><Slider<br>
  710. x:Name="t"<br>
  711. Width="200"<br>
  712. Height="200"<br>
  713. Margin="0,30"<br>
  714. Maximum="1000"<br>
  715. Minimum="1"<br>
  716. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  717. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  718. <Label Content="设置Interval" />
  719. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  720. <Label Content="当前值" />
  721. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  722. <p><Slider<br>
  723. x:Name="t"<br>
  724. Width="200"<br>
  725. Height="200"<br>
  726. Margin="0,30"<br>
  727. Maximum="1000"<br>
  728. Minimum="1"<br>
  729. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  730. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  731. <Label Content="设置Interval" />
  732. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  733. <Label Content="当前值" />
  734. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  735. <p><Slider<br>
  736. x:Name="t"<br>
  737. Width="200"<br>
  738. Height="200"<br>
  739. Margin="0,30"<br>
  740. Maximum="1000"<br>
  741. Minimum="1"<br>
  742. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  743. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  744. <Label Content="设置Interval" />
  745. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  746. <Label Content="当前值" />
  747. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  748. <p><Slider<br>
  749. x:Name="t"<br>
  750. Width="200"<br>
  751. Height="200"<br>
  752. Margin="0,30"<br>
  753. Maximum="1000"<br>
  754. Minimum="1"<br>
  755. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  756. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  757. <Label Content="设置Interval" />
  758. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  759. <Label Content="当前值" />
  760. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  761. <p><Slider<br>
  762. x:Name="t"<br>
  763. Width="200"<br>
  764. Height="200"<br>
  765. Margin="0,30"<br>
  766. Maximum="1000"<br>
  767. Minimum="1"<br>
  768. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  769. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  770. <Label Content="设置Interval" />
  771. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  772. <Label Content="当前值" />
  773. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  774. <p><Slider<br>
  775. x:Name="t"<br>
  776. Width="200"<br>
  777. Height="200"<br>
  778. Margin="0,30"<br>
  779. Maximum="1000"<br>
  780. Minimum="1"<br>
  781. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  782. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  783. <Label Content="设置Interval" />
  784. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  785. <Label Content="当前值" />
  786. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  787. <p><Slider<br>
  788. x:Name="t"<br>
  789. Width="200"<br>
  790. Height="200"<br>
  791. Margin="0,30"<br>
  792. Maximum="1000"<br>
  793. Minimum="1"<br>
  794. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  795. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  796. <Label Content="设置Interval" />
  797. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  798. <Label Content="当前值" />
  799. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  800. <p><Slider<br>
  801. x:Name="t"<br>
  802. Width="200"<br>
  803. Height="200"<br>
  804. Margin="0,30"<br>
  805. Maximum="1000"<br>
  806. Minimum="1"<br>
  807. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  808. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  809. <Label Content="设置Interval" />
  810. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  811. <Label Content="当前值" />
  812. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  813. <p><Slider<br>
  814. x:Name="t"<br>
  815. Width="200"<br>
  816. Height="200"<br>
  817. Margin="0,30"<br>
  818. Maximum="1000"<br>
  819. Minimum="1"<br>
  820. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  821. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  822. <Label Content="设置Interval" />
  823. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  824. <Label Content="当前值" />
  825. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  826. <p><Slider<br>
  827. x:Name="t"<br>
  828. Width="200"<br>
  829. Height="200"<br>
  830. Margin="0,30"<br>
  831. Maximum="1000"<br>
  832. Minimum="1"<br>
  833. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  834. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  835. <Label Content="设置Interval" />
  836. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  837. <Label Content="当前值" />
  838. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  839. <p><Slider<br>
  840. x:Name="t"<br>
  841. Width="200"<br>
  842. Height="200"<br>
  843. Margin="0,30"<br>
  844. Maximum="1000"<br>
  845. Minimum="1"<br>
  846. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  847. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  848. <Label Content="设置Interval" />
  849. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  850. <Label Content="当前值" />
  851. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  852. <p><Slider<br>
  853. x:Name="t"<br>
  854. Width="200"<br>
  855. Height="200"<br>
  856. Margin="0,30"<br>
  857. Maximum="1000"<br>
  858. Minimum="1"<br>
  859. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  860. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  861. <Label Content="设置Interval" />
  862. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  863. <Label Content="当前值" />
  864. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  865. <p><Slider<br>
  866. x:Name="t"<br>
  867. Width="200"<br>
  868. Height="200"<br>
  869. Margin="0,30"<br>
  870. Maximum="1000"<br>
  871. Minimum="1"<br>
  872. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  873. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  874. <Label Content="设置Interval" />
  875. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  876. <Label Content="当前值" />
  877. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  878. <p><Slider<br>
  879. x:Name="t"<br>
  880. Width="200"<br>
  881. Height="200"<br>
  882. Margin="0,30"<br>
  883. Maximum="1000"<br>
  884. Minimum="1"<br>
  885. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  886. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  887. <Label Content="设置Interval" />
  888. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  889. <Label Content="当前值" />
  890. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  891. <p><Slider<br>
  892. x:Name="t"<br>
  893. Width="200"<br>
  894. Height="200"<br>
  895. Margin="0,30"<br>
  896. Maximum="1000"<br>
  897. Minimum="1"<br>
  898. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  899. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  900. <Label Content="设置Interval" />
  901. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  902. <Label Content="当前值" />
  903. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  904. <p><Slider<br>
  905. x:Name="t"<br>
  906. Width="200"<br>
  907. Height="200"<br>
  908. Margin="0,30"<br>
  909. Maximum="1000"<br>
  910. Minimum="1"<br>
  911. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  912. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  913. <Label Content="设置Interval" />
  914. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  915. <Label Content="当前值" />
  916. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  917. <p><Slider<br>
  918. x:Name="t"<br>
  919. Width="200"<br>
  920. Height="200"<br>
  921. Margin="0,30"<br>
  922. Maximum="1000"<br>
  923. Minimum="1"<br>
  924. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  925. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  926. <Label Content="设置Interval" />
  927. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  928. <Label Content="当前值" />
  929. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  930. <p><Slider<br>
  931. x:Name="t"<br>
  932. Width="200"<br>
  933. Height="200"<br>
  934. Margin="0,30"<br>
  935. Maximum="1000"<br>
  936. Minimum="1"<br>
  937. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  938. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  939. <Label Content="设置Interval" />
  940. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  941. <Label Content="当前值" />
  942. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  943. <p><Slider<br>
  944. x:Name="t"<br>
  945. Width="200"<br>
  946. Height="200"<br>
  947. Margin="0,30"<br>
  948. Maximum="1000"<br>
  949. Minimum="1"<br>
  950. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  951. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  952. <Label Content="设置Interval" />
  953. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  954. <Label Content="当前值" />
  955. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  956. <p><Slider<br>
  957. x:Name="t"<br>
  958. Width="200"<br>
  959. Height="200"<br>
  960. Margin="0,30"<br>
  961. Maximum="1000"<br>
  962. Minimum="1"<br>
  963. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  964. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  965. <Label Content="设置Interval" />
  966. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  967. <Label Content="当前值" />
  968. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  969. <p><Slider<br>
  970. x:Name="t"<br>
  971. Width="200"<br>
  972. Height="200"<br>
  973. Margin="0,30"<br>
  974. Maximum="1000"<br>
  975. Minimum="1"<br>
  976. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  977. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  978. <Label Content="设置Interval" />
  979. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  980. <Label Content="当前值" />
  981. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  982. <p><Slider<br>
  983. x:Name="t"<br>
  984. Width="200"<br>
  985. Height="200"<br>
  986. Margin="0,30"<br>
  987. Maximum="1000"<br>
  988. Minimum="1"<br>
  989. Orientation="Horizontal" /></p></ListBox><ListBox Width="140" Margin="0,50"><Label Content="设置Delay" />
  990. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  991. <Label Content="设置Interval" />
  992. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  993. <Label Content="当前值" />
  994. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  995. <p><Slider<br>
  996. x:Name="t"<br>
  997. Width="200"<br>
  998. Height="200"<br>
  999. Margin="0,30"<br>
  1000. Maximum="1000"<br>
  1001. Minimum="1"<br>
  1002. Orientation="Horizontal" /></p>    <ListBoxItem Content="男" /><Label Content="设置Delay" />
  1003. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  1004. <Label Content="设置Interval" />
  1005. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  1006. <Label Content="当前值" />
  1007. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  1008. <p><Slider<br>
  1009. x:Name="t"<br>
  1010. Width="200"<br>
  1011. Height="200"<br>
  1012. Margin="0,30"<br>
  1013. Maximum="1000"<br>
  1014. Minimum="1"<br>
  1015. Orientation="Horizontal" /></p>    <ListBoxItem Content="女" /><Label Content="设置Delay" />
  1016. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  1017. <Label Content="设置Interval" />
  1018. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  1019. <Label Content="当前值" />
  1020. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  1021. <p><Slider<br>
  1022. x:Name="t"<br>
  1023. Width="200"<br>
  1024. Height="200"<br>
  1025. Margin="0,30"<br>
  1026. Maximum="1000"<br>
  1027. Minimum="1"<br>
  1028. Orientation="Horizontal" /></p>    <ListBoxItem Content="其他" /><Label Content="设置Delay" />
  1029. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  1030. <Label Content="设置Interval" />
  1031. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  1032. <Label Content="当前值" />
  1033. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  1034. <p><Slider<br>
  1035. x:Name="t"<br>
  1036. Width="200"<br>
  1037. Height="200"<br>
  1038. Margin="0,30"<br>
  1039. Maximum="1000"<br>
  1040. Minimum="1"<br>
  1041. Orientation="Horizontal" /></p></ListBox>
复制代码
效果如下<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>同时也支持CheckBox<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>2.2 - ComboBox<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>与ListBox类似包含的是ComboBoxItem对象也是可以嵌套任意元素的内容控件。区别在与一个是展示一个是下拉,下拉意味着只可以选择一项。具体代码就不演示了。可以自行操作一下<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>3 - 基于范围的控件<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>WPF提供了三个使用范围概念的控件<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>ScrollBar、ProgressBar以及之前我们用到过的Slider 他们都继承于RangeBase类<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>虽然他们都是范围控件但是使用起来却又很大区别,接下来我们简单的一一介绍一下RangeBase的属性。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>Value:当前值<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>Maximum:最大值<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>Minimum:最小值<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>SmallChange:向上或者向下调整的数量<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>LargeChange:同上<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>通常Slider和ProgressBar更常用<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>3.1 - Slider<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>之前我们已经简单使用过Slider了。接下来我们介绍下Slider的附加属性<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>从本节开始介绍一个属性开始演示一个属性<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>1)Orientation 竖直滚动条和水平滚动条<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>2)Delay和Interval<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>说明:Delay指的是当你点击时,反应的时间、Interval指的是你当前和你之后的响应时间<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>Demo如下<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
  1. <Label Content="设置Delay" />
  2. <TextBox Text="{Binding ElementName=t, Path=Delay}" />
  3. <Label Content="设置Interval" />
  4. <TextBox Text="{Binding ElementName=t, Path=Interval}" />
  5. <Label Content="当前值" />
  6. <TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
  7. <p><Slider<br>
  8. x:Name="t"<br>
  9. Width="200"<br>
  10. Height="200"<br>
  11. Margin="0,30"<br>
  12. Maximum="1000"<br>
  13. Minimum="1"<br>
  14. Orientation="Horizontal" /></p>
复制代码
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>动图中黄色代表鼠标点击,常亮代表一直按着没放<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>3)TickPlacement 当为左右Slider时 设置TopLeft为上边<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>设置BottomRight时在下边<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>当为上下Slider时 设置TopLeft在左边
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>当为上下Slider时 设置BottomRight时在右边
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>当设置为Both时两边都有
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>设置为None时 没有【默认为None】<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>4)TickFrequency 刻度<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>该属性代表了在刻度尺上边每个点代表多少。比如我们代码中设置最大值为1000,刻度为50,则代表着界面上一共有20个点。如图所示
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>此时如果我们将TickFrequency改为100则界面应该变为10个点
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>5)Ticks<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>效果如图所示【为了能看得更清我将标尺颜色设置为Orange】
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>6)IsSnapToTickEnabled 默认跳转合适位置默认为False<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>7)IsSelectionRangeEnabled<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>废话不说直接上图<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>其中我们需要设置SelectionStart和End 常见比如我们看电视的时候的进度条便是如此
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>至此基本的属性已经说完了,另外比如我们需要设置每次滑动不允许有小数时可以这么去处理
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>这样的话我们滑动的时候就不会出现小数的情况了<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>至此Slider我们就说完了。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>3.2 - ProgressBar<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>其中有个IsIndeterminate属性是设置周期性从左到右的脉冲。相当于一个加载提示一样。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>ProgressBarDemo<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
  1. [/code][code]private void Button_Click(object sender, RoutedEventArgs e)
  2. {
  3.     for (int i = 1; i < 101; i++)
  4.     {
  5.         pb.Dispatcher.Invoke(new Action<System.Windows.DependencyProperty, object>(pb.SetValue), System.Windows.Threading.DispatcherPriority.Background, ProgressBar.ValueProperty, Convert.ToDouble(i));
  6.         Thread.Sleep(new Random().Next(10,200));
  7.     }
  8. }
复制代码
效果<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>4 - 日期控件<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>在WPF中包含了两个日期控件,分别是Calendar和DatePicker,都是能够选择日期的<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>Calendar:显示日历<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>DatePicker:与之前用的日期控件大致相仿<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>我们先预览一下这两个控件<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>接下来我们介绍一下两者对应的属性吧<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>1)DisplayDateStart和DisplayDateEnd<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>设置对应的日期范围
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>2)BlackoutDates 分为Add对应时间段和AddDatesInPast当前时间之前的<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>3)SelectedDate 选中日期
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>4)SelectedDates 选择的所对应日期 Calendar支持该属性 且需要设置SelectionMode才允许Mode分别是MultipleRange SingleDate和SingleRange只有设置为允许选择多个时才有用。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>5)FirstDayOfWeek 日历中首个星期几
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>6) IsTodayHighLighted 今日是否高亮
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>7)DisplayMode 只能用于Calendar 指的是初始化显示的方式 年月日<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>8) IsDropDownOpen 用于DatePicker 设置是否打开下拉日历<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>9)SelectedDateFormat 选中日期格式
<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>控件小结<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>至此基础控件基本简单介绍完成了。可以根据已经掌握的控件搭建一个界面或者窗体进行小测试。不需要有对应业务实现,只是界面。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>学习完之后我们能够更容易创建设计WPF中的窗体。<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p><Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>来源:https://www.cnblogs.com/iceamos/archive/2023/03/10/17203857.html<Label Content="设置Delay" />
<TextBox Text="{Binding ElementName=t, Path=Delay}" />
<Label Content="设置Interval" />
<TextBox Text="{Binding ElementName=t, Path=Interval}" />
<Label Content="当前值" />
<TextBox Text="{Binding ElementName=t, Path=Value, Mode=TwoWay}" />
<p><Slider<br>
x:Name="t"<br>
Width="200"<br>
Height="200"<br>
Margin="0,30"<br>
Maximum="1000"<br>
Minimum="1"<br>
Orientation="Horizontal" /></p>免责声明:由于采集信息均来自互联网,如果侵犯了您的权益,请联系我们【E-Mail:cb@itdo.tech】 我们会及时删除侵权内容,谢谢合作!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x

举报 回复 使用道具