Here is Part 2In this article we will be seeing how to create Silverlight Slider control to change the color of the rectangle using SolidColorBrush.Slider Control is used to allow the user to select from a range of values by moving the Thumb control.Namespace: System.Windows.ControlsAssembly: System.Windows (in System.Windows.dll) Xaml: <Slider></Slider>Steps Involved:Creating a Silverlight Application:
Open MainPage.xaml.cs file and replace the code with the following. private void slider_ValueChanged(object sender,RoutedPropertyChangedEventArgs<double> e) { Color textColor = new Color(); textColor.A = 255; textColor.R = (byte)redSlider.Value; textColor.G = (byte)greenSlider.Value; textColor.B = (byte)blueSlider.Value;
SolidColorBrush textBrush = new SolidColorBrush(textColor); rectangle.Fill = textBrush; }
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: