Wednesday, February 11, 2009

Silverlight Tip of the Day #9 – How to make your Silverlight Control Transparent.

In order to make your Silverlight control transparent to the background of your web site you have to do two things.

From an ASPX page:

Add the tag PluginBackground="Transparent" to your Silverlight control.
Add the tag Windowless="true" to your Silverlight control.
Example:




From an HTML page:

Add the param: Add the param:
Example:







Notes:

By default your Silverlight control takes up the entire page. This is because the Width and Height are set to 100%. If you want the control to only consume part of the page change these values to represent what you want. For example, to make the control 400x400 pixels on the page you can set it like this:



Thank you,

0 comments:

Post a Comment