1、checkbox
选项控件
Checked和Unchecked事件最重要
2、combobox
下拉框控件
最重要的事件是
SelectionChanged 在当前选定项更改时发生
3、代码:
Partial Public Class MainPage
Inherits UserControl
Private currentlocation As Point
Public Sub New()
InitializeComponent()
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
ComboBox1.Items.Add(TextBox1.Text)
End Sub
Private Sub LayoutRoot_MouseMove(sender As System.Object, e As System.Windows.Input.MouseEventArgs) Handles LayoutRoot.MouseMove
currentlocation = e.GetPosition(LayoutRoot)
Label2.Content = "现在鼠标的坐标是:(" & currentlocation.X.ToString() & "," & currentlocation.Y.ToString() & ")"
End Sub
Private Sub CheckBox1_Checked(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles CheckBox1.Checked
Label1.Content = "您好,您选中了!"
End Sub
Private Sub CheckBox1_Unchecked(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles CheckBox1.Unchecked
Label1.Content = "您好,您没有选择!"
End Sub
Private Sub ComboBox1_SelectionChanged(sender As System.Object, e As System.Windows.Controls.SelectionChangedEventArgs) Handles ComboBox1.SelectionChanged
Label4.Content = ComboBox1.SelectedValue
End Sub
End Class
上面这个代码,当在文本框中输入任何内容后,这些内容将做为下拉框的选项之一,也就是 说下拉框的选项是动态增加的
- 大小: 26 KB
分享到:
相关推荐
1、Silverlight(3) - 2.0控件之Border, Button, Calendar, Canvas, CheckBox, ComboBox 2、Silverlight(4) - 2.0控件之DataGrid, DatePicker, Grid, GridSplitter, HyperlinkButton, Image 3、Silverlight(5) - ...
Silverlight(3) - 2.0控件之Border, Button, Calendar, Canvas, CheckBox, ComboBox 介绍 Silverlight 2.0 控件一览:Border, Button, Calendar, Canvas, CheckBox, ComboBox 2、Silverlight(4) - 2.0控件之...
网上的一个silverlight的树形下拉控件,改成wpf使用的了,希望对各位有所帮助。
silverlight程序测试,datagrid checkbox combobox
一套蓝色的siverlight控件样式包括button,textbox,ComboBox,RadioButton,-CheckBox等11个控件样式
六、TextBlock控件 5 七、ToolTip控件 <用作内嵌控件时> 6 八、Rectangle控件 7 九、Slider控件(滑动控件) 7 十、DatePicker控件 7 十一、Image控件 8 十二、Calendar控件 8 十三、Button控件 10 十四、CheckBox...