稳扎稳打Silverlight(6) - 2.0控件之ScrollViewer,Slider,StackPanel,TabControl,TextBlock,TextBox,ToggleButton
在线DEMO
http://www.cnblogs.com/webabcd/archive/2008/10/09/1307486.html
示例
1、ScrollViewer.xaml
<UserControl x:Class="Silverlight20.Control.ScrollViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<!--
ScrollViewer.Content - ScrollViewer控件中的内容
HorizontalScrollBarVisibility - 水平滚动条的显示状态
VerticalScrollBarVisibility - 垂直滚动条的显示状态
Auto - 自动根据ScrollViewer的宽和高,以及内容的宽和高,来决定是否显示滚动条
Disabled - 不显示,但是可以通过键盘或鼠标在显示内容中的移动或拖动操作,来看到被遮挡的内容
Hidden - 不显示,而且无法看到被遮挡的内容
Visible - 显示滚动条
-->
<ScrollViewer Margin="5" Width="200" Height="200" HorizontalAlignment="Left" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<ScrollViewer.Content>
<Image Source="/Silverlight20;component/Images/Logo.jpg" Width="300" />
</ScrollViewer.Content>
</ScrollViewer>
<ScrollViewer Margin="5" Width="100" Height="100" HorizontalAlignment="Left" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<TextBox>
<TextBox.Text>
aaa
bbb
ccc
ddd
eee
fff
ggg
hhh
iii
jjj
kkk
lll
mmm
nnn
</TextBox.Text>
</TextBox>
</ScrollViewer>
</StackPanel>
</UserControl>