ScrollViewer 컨트롤
.NET프로그래밍/Silverlight 3.0 2009. 12. 2. 12:06 |- [MainPage.xaml]소스코드와 [RiaScrollViewerTestPage.html] 소스코드를 아래 형광펜 칠해진 부분과 같이 수정하여, 웹페이지 전체에서 일부분의 실버라이트영역만 지정하고 ScrollViewer 컨트롤을 사용하여 지정된 실버라이트 영역만 본다.
[MainPage.xaml]
<UserControl x:Class="RiaScrollViewer.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="300">
<Grid x:Name="LayoutRoot" Background="White">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<TextBlock FontSize="72">
<Run>안녕하세요.</Run>
<LineBreak></LineBreak>
<Run>반갑습니다. 또 만나요.</Run>
</TextBlock>
</ScrollViewer>
</Grid>
</UserControl>
[RiaScrollViewerTestPage.html 소스코드 수정]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>RiaScrollViewer</title>
<style type="text/css">
html, body {
height: 100%;
overflow: auto;
}
body {
padding: 0;
margin: 0;
}
#silverlightControlHost {
width: 300px;
height: 100px;
text-align:center;
}
</style>
[실행결과]
--> [RiaScrollViewerTestPage.html]에서 "브라우저에서 보기"로 실행했을 때의 화면.
'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글
ComboBox 컨트롤 (여러개의 항목 중 하나를 선택 가능) (0) | 2009.12.02 |
---|---|
ScrollBar 컨트롤 (0) | 2009.12.02 |
ToolTip 컨트롤 (풍선도움말 제공) (0) | 2009.12.02 |
CheckBox 컨트롤 (0) | 2009.12.02 |
RadioButton 컨트롤 (0) | 2009.12.02 |