Page view counter

Silverlight Tips of the Day - Blog by Mike Snow

Game Programming with Silverlight

Silverlight Tip of the Day #51 – How to Enable and Disable Controls

With Silverlight 2 RC0 Silverlight Controls can now be enabled/disabled via the property IsEnabled. This property is supported with all XAML controls found in the toolbox except those controls that are non-interactive (I.e. An ellipse, image, line, etc). By default all controls are enabled so you really only need to add this property if you want to set it to false in order to disable the control.

In addition to the property IsEnabled an event called IsEnableChanged is now available.

When setting IsEnabled=”false” the control is grayed out and will not respond to user interaction.

The following example has two sliders with the first one enabled and the second one disabled:

<Slider Canvas.Top="300" Width="300" Margin="20"></Slider>
<Slider IsEnabled="False"  Canvas.Top="340" Width="300" Margin="20"></Slider>

Screen shot:

image

Thank you,
--Mike Snow

 Subscribe in a reader

Comments

Microsoft Weblogs said:

With Silverlight 2 RC0 Silverlight Controls can now be enabled/disabled via the property IsEnabled .

# September 30, 2008 1:58 PM

Dew Drop – September 30, 2008 (Evening Edition) | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop &ndash; September 30, 2008 (Evening Edition) | Alvin Ashcraft's Morning Dew

# September 30, 2008 10:29 PM

2008 October 01 - Links for today « My (almost) Daily Links said:

Pingback from  2008 October 01 - Links for today &laquo; My (almost) Daily Links

# October 1, 2008 3:57 AM

Community Blogs said:

In this post: Mike Snow, Bill Reiss, Jesse Liberty, Harsh Bardhan, Tim Heuer, Matthias Shapiro, and Jeff

# October 1, 2008 9:53 AM

Visual Web Developer Team Blog said:

Silverlight Tip of the Day #57 Title: How to Dynamically Load a Silverlight Control within another Silverlight

# October 8, 2008 11:05 PM

MS Tech News » Silverlight Tips of the Day ??? Week 8 said:

Pingback from  MS Tech News &raquo; Silverlight Tips of the Day ??? Week 8

# October 27, 2008 3:26 PM

MS Tech News » Silverlight Tips of the Day ??? Week 8 said:

Pingback from  MS Tech News &raquo; Silverlight Tips of the Day ??? Week 8

# October 27, 2008 3:32 PM

Silverlight Tips of the Day - Blog by Mike Snow said:

The purpose of this post is to create an outline summary all the blogs from my Silverlight tips of the

# January 2, 2009 5:56 PM

o UAU nosso de cada dia said:

essa lista eu copiei desse blog bárbaro (acompanhe por RSS você também): uma lista de dicas super úteis

# January 3, 2009 6:25 AM