英語で読む

次の方法で共有


ExpandDirection 列挙型

定義

Expander コントロールが開く方向を指定します。

C#
public enum ExpandDirection
継承
ExpandDirection

フィールド

名前 説明
Down 0

Expander コントロールは下に開きます。

Left 2

Expander コントロールは左に開きます。

Right 3

Expander コントロールは右に開きます。

Up 1

Expander コントロールは上に開きます。

次の例は、 プロパティを列挙メンバーに設定 ExpandDirection する方法を ExpandDirection 示しています。

XAML
<StackPanel>
  <RadioButton Name="ExpandDown" Margin="0,10,0,10" 
            IsChecked="True"
            Checked="ChangeExpandDirection"
            GroupName="ExpandDirectionProperty">
     Expand Down
  </RadioButton>
  <RadioButton Name="ExpandUp" Margin="0,0,0,10"
            Checked="ChangeExpandDirection"
            GroupName="ExpandDirectionProperty">
     Expand Up
  </RadioButton>
  <RadioButton Name="ExpandLeft" Margin="0,0,0,10"
            Checked="ChangeExpandDirection"
            GroupName="ExpandDirectionProperty">
    Expand Left
  </RadioButton>
  <RadioButton Name="ExpandRight" Margin="0,0,0,10"
            Checked="ChangeExpandDirection"
            GroupName="ExpandDirectionProperty">
    Expand Right
  </RadioButton>
</StackPanel>
C#
private void ChangeExpandDirection(object sender, RoutedEventArgs e)
{
    if ((Boolean)ExpandDown.IsChecked)
        myExpander.ExpandDirection = ExpandDirection.Down;
    else if ((Boolean)ExpandUp.IsChecked)
        myExpander.ExpandDirection = ExpandDirection.Up;
    else if ((Boolean)ExpandLeft.IsChecked)
        myExpander.ExpandDirection = ExpandDirection.Left;
    else if ((Boolean)ExpandRight.IsChecked)
        myExpander.ExpandDirection = ExpandDirection.Right;

    //Expand myExpander so it is easier to see the effect of changing 
    //the ExpandDirection property for My Expander
    myExpander.IsExpanded = true;
}

注釈

コントロールが展開する方向を Expander 指定するには、 プロパティを ExpandDirection 列挙メンバーのいずれかに設定します。

適用対象

製品 バージョン
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

こちらもご覧ください