動作環境
Windows 7 Pro (32bit)
Microsoft Visual Studio 2017 Community
Sublime Text 2
@ WPF 4.5入門 by 大田一希さん
No.2134 / 9985
ScrollViewerコントロールは、名前のとおり子要素がScrollViewerより大きな場合にスクロールバーを出して要素を閲覧できるようにするコントロールです。
<StackPanel>
とあわせて使うなどするようだ。
スクロール例を作ってみた。
XAML
<Window x:Class="_170423_t1935_border.MainWindow"
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"
xmlns:local="clr-namespace:_170423_t1935_border"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<ScrollViewer Width="200" Height ="250">
<StackPanel>
<Button Content="A" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" A" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" A" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" A" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" A" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" A" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" A" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" A" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" !" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" *" HorizontalAlignment="Left" Height="50" Width="180"/>
<Button Content=" *" HorizontalAlignment="Left" Height="50" Width="180"/>
</StackPanel>
</ScrollViewer>
</Grid>
</Window>
3行しか表示領域がないワードプロセッサ(書院?)でスクロールゲーム(というか、ただのマップ)を作ったのは27年前くらいの話。