How to Scale your Silverlight Control
2009-01-14 19:09
323 查看
One often unknown property your Silverlight control contains is a property called ScaleMode. This property allows you to specify how the controls within your Silverlight application are scaled when your Silverlight control is resized.
For example, if the width or height of your Silverlight control is set to be a percentage of your browser web page than when the browser page is resize so will your Silverlight control.
The three options available for the property ScaleMode are:
None – No scaling is performed
Scale - Scaling is performed to fill the browser horizontally and vertically.
Zoom – Scaling is performed to proportionally fill the browser.
The following is an example of how to set this ScaleMode to Stretch in your ASPX page:
<asp:Silverlight ID="Xaml1" ScaleMode="Stretch" runat="server" Source="~/ClientBin/SilverlightApplication52.xap" MinimumVersion="2.0.31222.0" Width="100%" Height="100%" />
Before a browser resize:
After a browser resize (notice that the button scales):
For example, if the width or height of your Silverlight control is set to be a percentage of your browser web page than when the browser page is resize so will your Silverlight control.
The three options available for the property ScaleMode are:
None – No scaling is performed
Scale - Scaling is performed to fill the browser horizontally and vertically.
Zoom – Scaling is performed to proportionally fill the browser.
The following is an example of how to set this ScaleMode to Stretch in your ASPX page:
<asp:Silverlight ID="Xaml1" ScaleMode="Stretch" runat="server" Source="~/ClientBin/SilverlightApplication52.xap" MinimumVersion="2.0.31222.0" Width="100%" Height="100%" />
Before a browser resize:
After a browser resize (notice that the button scales):
相关文章推荐
- HOW to get control your time and your life
- How to use Tower on Mac to control your local Xcode Projects
- 《How to Get Control of Your Time and Your Life》
- How To Take Control Over Your Life
- How to get control of your time and your life (Alan Lakein.)
- How to set bmp for your UserControl in the toolbox
- how to write your annotation types and make use of built-in annotations to control their behavior
- How to get control of your time and life
- How to get control of your time and your life
- 如何掌控自己的时间和生活(how to get control of your time and your life)读书笔记
- How to Take Control of Your Line Height in Outlook.com
- WinForms Controls > Examples > How to: Add New XtraForm, RibbonForm and XtraUserControl to Your Proj
- 6 methods to control what and how your content appears in search engines
- How to render your control’s client script
- How to control your dust collection with an Arduino (it's easy)
- How to get control of your time and your life
- How to register your own or the third ActiveX Control to the target PC using InstallShield 11.5 Pre Edition?
- How to attach behavior in code behind (Silverlight 3)
- Android Build System ---- how to add your product and board config *.mk
- HOW TO RUN YOUR WEB SERVER AND MQTT WEBSOCKETS BROKER ON THE SAME PORT