WinStore控件之Button、HyperlinkButton、RadioButton、CheckBox、progressBar、ScrollViewer、Slider
2014-10-08 15:58
483 查看
1、Button
Slider
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <StackPanel> <Grid Name="controlGrid" Grid.Row="0" Grid.Column="0"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBlock Grid.Column="0" Grid.Row="0" Text="红色" Foreground="Red" FontSize="20" /> <Slider x:Name="redSlider" Grid.Column="0" Grid.Row="1" Foreground="Red" Minimum="0" Maximum="255" ValueChanged="OnSliderValueChanged" /> <TextBlock x:Name="redText" Grid.Column="0" Grid.Row="2" Text="0" Foreground="Red" FontSize="20"/> <TextBlock Grid.Column="1" Grid.Row="0" Text="绿色" Foreground="Green" FontSize="20" /> <Slider x:Name="greenSlider" Grid.Column="1" Grid.Row="1" Foreground="Green" Minimum="0" Maximum="255" ValueChanged="OnSliderValueChanged" /> <TextBlock x:Name="greenText" Grid.Column="1" Grid.Row="2" Text="0" Foreground="Green" FontSize="20" /> <TextBlock Grid.Column="2" Grid.Row="0" Text="蓝色" Foreground="Blue" FontSize="20"/> <Slider x:Name="blueSlider" Grid.Column="2" Grid.Row="1" Foreground="Blue" Minimum="0" Maximum="255" ValueChanged="OnSliderValueChanged" /> <TextBlock x:Name="blueText" Grid.Column="2" Grid.Row="2" Text="0" Foreground="Blue" FontSize="20" /> </Grid> <Ellipse Height="100" x:Name="ellipse1" Stroke="Black" StrokeThickness="1" Width="224" /> <TextBlock x:Name="textBlock1" Text="颜色" FontSize="26"/> </StackPanel> </Grid>
Slider
public MainPage() { InitializeComponent(); redSlider.Value = 128; greenSlider.Value = 128; blueSlider.Value = 128; } void OnSliderValueChanged(object sender, RangeBaseValueChangedEventArgs e) { Color clr = Color.FromArgb(255, (byte)redSlider.Value, (byte)greenSlider.Value, (byte)blueSlider.Value); ellipse1.Fill = new SolidColorBrush(clr); textBlock1.Text = clr.ToString(); redText.Text = clr.R.ToString("X2"); greenText.Text = clr.G.ToString("X2"); blueText.Text = clr.B.ToString("X2"); }
相关文章推荐
- 重新想象 Windows 8 Store Apps (2) - 控件之按钮控件: Button, HyperlinkButton, RepeatButton, ToggleButton, RadioButton, CheckBox, ToggleSwitch
- 重新想象 Windows 8 Store Apps (2) - 控件之按钮控件: Button, HyperlinkButton, RepeatButton, ToggleButton, RadioButton, CheckBox, ToggleSwitch
- Android 常用控件自定义样式RadioButton、CheckBox、ProgressBar、
- Android 常用控件自定义样式RadioButton、CheckBox、ProgressBar、
- silverlight系列(Button、HyperlinkButton、Checkbox、Combox、ListBox、Slider、RadionButton)
- android组件介绍:textview、button、radiobutton、checkbox、chronometer、spinner、progressbar、seekbar等
- wxPython常用控件--wx.RadioButton,wx.CheckBox,wx.Choice,wx.Slider,wx.SpinCtrl,wx.Timer,wx.Dialog
- Silverlight控件用法合集DataGrid,ComboBox,DataPick,CheckBox,RadioButtonSilverlight控件用法合集DataGrid,ComboBox,DataPick,CheckBox,RadioButton
- 系出名门Android(5) - 控件(View)之TextView, Button, ImageButton, ImageView, CheckBox, RadioButton, AnalogClock, DigitalClock
- 系出名门Android(5) - 控件(View)之TextView, Button, ImageButton, ImageView, CheckBox, RadioButton, AnalogClock, DigitalClock
- Android - 控件(View)之TextView, Button, ImageButton, ImageView, CheckBox, RadioButton, AnalogClock, DigitalClock 的简单介绍
- silverlight系列(Button、HyperlinkButton、Checkbox、Combox、ListBox、Slider、RadionButton)
- 控件(View)之TextView, Button, ImageButton, ImageView, CheckBox, RadioButton, AnalogClock, DigitalClock【转】
- Android控件之Button,RadioButton,CheckBox,DatePicker,DatePickerDialog的使用
- Jquery主要控件的取值、赋值,包括textbox,button,lable,radio,checkbox,selected
- 103.Daikon Forge高级控件checkbox、dropdownlist、listbox、progressbar
- 【读书笔记-《Android游戏编程之从零开始》】4.Android 游戏开发常用的系统控件(EditText、CheckBox、Radiobutton)
- Jquery主要控件的取值、赋值,包括textbox,button,lable,radio,checkbox,selected
- Android控件CheckBox、RadioButton
- ExtJs4 笔记(8) Ext.slider 滚轴控件、 Ext.ProgressBar 进度条控件、 Ext.Editor 编辑控件