WHO IS THIS?

July 27, 2009

Silverlight Controls

Filed under: Silverlight — sivasrec @ 6:06 am

Button:

<UserControl x:Class=”SilverlightApplication6.Page”
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
Width=”400″ Height=”300″>
<Grid x:Name=”LayoutRoot” Background=”White”>
<RadioButton    GroupName=” ss” Canvas.Left=” 90″ Canvas.Top=”60″ Content=”hai” Height=”100″ Width=”200″ ClickMode=”Hover” ></RadioButton>
<RadioButton GroupName=” pp” Canvas.Left=” 50″ Canvas.Top=” 50″ Content=”hello” ></RadioButton>
<Button Content=”Click Me”
Height=”50″
Width=”150″
FontFamily=”Trebuchet”
FontSize=”24″
FontWeight=”Bold”
FontStyle=”Italic”
Foreground=”Red”
Background=”Blue”>
</Button>
</Grid>
</UserControl>

<UserControl x:Class=”SilverlightApplication6.Page”

xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”

xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”

Width=”400″ Height=”300″>

<Grid x:Name=”LayoutRoot” Background=”White”>

<Button Content=”Click Me”

Height=”50″

Width=”150″

FontFamily=”Trebuchet”

FontSize=”24″

FontWeight=”Bold”

FontStyle=”Italic”

Foreground=”Red”

Background=”Blue”>

</Button>

</Grid>

</UserControl>

Output:

sbutton1

Radio Button:

Properties:

The RadioButton control also defaults to unchecked; however, you can define it as being set initially in XAML using the IsChecked property.

Another interesting property of the RadioButton control is the ClickMode. You can set the ClickMode property to set the radio button on mouse Hover, Press, or Release.

<RadioButton    GroupName=” ss” Canvas.Left=” 90″ Canvas.Top=”60″ Content=”hai” Height=”100″ Width=”200″ ClickMode=”Hover” IsChecked=”True” ></RadioButton>

<RadioButton GroupName=”ss” Canvas.Left=” 50″ Canvas.Top=” 50″ Content=”hello”></RadioButton>

Output:

radiobutton

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.