Silverlight CheckBox Control

The Silverlight CheckBox that comes with Silverlight is similar in functionality to other checkboxes from other platforms, here we have a simple example showing how to use the CheckBox.

How to Use the CheckBox Control

To use the checkbox on your Silverlight page:

<UserControl x:Class="Checkbox_Test.Page"
    xmlns="http://schemas.microsoft.com/client/2007"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="400" Height="300">
    <Canvas>
        <CheckBox x:Name="testCheckBox" Canvas.Left="10" Canvas.Top="0" Content="This is a checkbox" Click="testCheckBox_Click" />
        <CheckBox x:Name="testCheckBox2" Canvas.Left="10" Canvas.Top="20" Content="This is another checkbox" />
    </Canvas>
</UserControl>


In your C# code behind file you can refer to the CheckBox using testCheckBox.  The Silverlight CheckBox has a Checked property which allows you to toggle the checked state, if you do not hook into this event then the CheckBox will toggle itself, however if you wish to override this event you must perform the toggle in addition to any custom code preformed.

<UserControl x:Class="Checkbox_Test.Page"
    xmlns="http://schemas.microsoft.com/client/2007"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="400" Height="300">
    <Canvas>
        <CheckBox x:Name="testCheckBox" Canvas.Left="10" Canvas.Top="0" Content="This is a checkbox" Click="testCheckBox_Click" />
        <CheckBox x:Name="testCheckBox2" Canvas.Left="10" Canvas.Top="20" Content="This is another checkbox" />
    </Canvas>
</UserControl>


The CheckBox exposes a click event which is fired (named Clicked) when the control is clicked on, you can attach an event handler to this to perform custom actions.

 
 
Latest Games
Zombie Escape
Apr 19, 2016
Plays: 2,801

Zombie Escape ScreenshotDrive fast before the crazy mutant zombies get you!

6 Ratings/4.1 Average
Car Parking
Jan 16, 2016
Plays: 2,672

Car Parking ScreenshotGuide the car to its parking space in this fun Car Parking game.

1 Rating/5 Average
Trash It
Jan 11, 2016
Plays: 2,511

Trash It ScreenshotAim for the Trash Can and get the various items of Trash in the bin.

4 Ratings/5 Average
Sky Fly
Jan 11, 2016
Plays: 2,716

Sky Fly ScreenshotFly your plane in this colorful vertical scrolling shoot-em-up. Blast the bad guys and collect any bonus's they leave behind.

1 Rating/5 Average
Professor Snappy
Jan 11, 2016
Plays: 2,178

Professor Snappy ScreenshotPop as many bubbles as possible in this fun and colorful bubble popping game. The levels start off easy enough but gradually get harder!

1 Rating/5 Average
Monster Match Saga
Jan 10, 2016
Plays: 2,507

Monster Match Saga ScreenshotHere we have a bunch of monsters that need to be matched up. Look out for the bomb and spinning monsters that will cause special damage!

3 Ratings/4.6 Average
Fly Bird Fly
Jan 10, 2016
Plays: 2,326

Fly Bird Fly ScreenshotGuide your friendly Bird through the maze of pipes and other obstacles collecting the Stars in this cool arcade game inspired by the legendary Flappy Bird.

1 Rating/5 Average
Life In One
Jan 10, 2016
Plays: 2,502

Life In One ScreenshotYou are stranded on an Alien planet. Your goal is to build a space rocket and escape. Start by building units to create power and mine the metal patches. Build defenses to defend your base from the advancing Aliens and Zombies!

2 Ratings/3 Average
X Pool
Jan 02, 2016
Plays: 3,144

X Pool ScreenshotPlay Pool against the computer or battle against your friends in the online mode!

3 Ratings/3 Average
Fruit Slicer
Jan 02, 2016
Plays: 2,215

Fruit Slicer ScreenshotSlice the fruit that is thrown up onto the screen. Slice the fruit into multiple pieces for maximum points!

1 Rating/5 Average