0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

WPF覚え書き~StackPanel~

Posted at

はじめに

WPF学習中のため自分用に記載していきます。
間違い、不足などありましたらコメントをよろしくお願いします。

StackPanelコントロール

子要素を縦並び(Vertical)にするか、横並び(Horizontal)にするか設定する


●StackPanelの子要素を縦並びにする
子要素のHorizontalAlignmentプロパティの水平方向の要素を指定することも可能

~省略~
<StackPanel Orientation="Vertical" >
   <Button Content="Button1" />
   <Button Content="Button2" />
   <Button Content="Button3" HorizontalAlignment="Left"/>
   <Button Content="Button4" HorizontalAlignment="Right"/>
</StackPanel>

●StackPanelの子要素を横並びにする
子要素のVerticalAlignmentプロパティの垂直方向の要素を指定することも可能

~省略~
<StackPanel Orientation="Horizontal" >
    <Button Content="Button1" />
    <Button Content="Button2" />
    <Button Content="Button3" VerticalAlignment="Top"/>
    <Button Content="Button4" VerticalAlignment="Bottom"/>
</StackPanel>

参照

かずきのBlog@hatena

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?