PowerTools PlusPak for Windows Forms 8.0J
DropDownDirection プロパティ (FontPickerDropDownSettings)
使用例 

関連付けられたGcFontPickerからフォントドロップダウンリストが開く方向を示す値を取得または設定します。
構文
Public Property DropDownDirection As DropDownDirection
public DropDownDirection DropDownDirection {get; set;}

プロパティ値

GrapeCity.Win.Common.DropDownDirection値の1つ。デフォルトはGrapeCity.Win.Common.DropDownDirection.Defaultです。
例外
例外解説
System.ComponentModel.InvalidEnumArgumentException指定された値がGrapeCity.Win.Common.DropDownDirection値の1つではありません。
使用例

次のサンプルコードは、GcFontPicker.DropDownSettingsプロパティ上でDropDownDirectionプロパティを設定して、GcFontPickerのドロップダウンリストのドロップダウン方向を設定します。この例を実行するには、以下のコードをSystem.Windows.Forms.Formに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出す必要があります。

private void CreateGcFontPickerWithDropDownSettings()
{
    // Create an instance of GcFontPicker control.
    GcFontPicker gcFontPicker = new GcFontPicker();

    // Initialize the Name and Location of the gcFontPicker.
    gcFontPicker.Name = "gcFontPicker";
    gcFontPicker.Location = new Point(10, 50);

    // Set some common properties on DropDownSettings.
    gcFontPicker.DropDownSettings.AutoDropDown = true;
    gcFontPicker.DropDownSettings.AutoWidth = true;
    gcFontPicker.DropDownSettings.DropDownDirection = GrapeCity.Win.Common.DropDownDirection.BelowRight;
    gcFontPicker.DropDownSettings.OpeningAnimation = GrapeCity.Win.Common.DropDownAnimation.Extend;
    gcFontPicker.DropDownSettings.ClosingAnimation = GrapeCity.Win.Common.DropDownAnimation.Extend;
    gcFontPicker.DropDownSettings.AllowResize = false;
    gcFontPicker.DropDownSettings.ShowShadow = false;

    // Set UseSystemVisualStyle to true, so that the drop-down list will be drawn by system
    // no matter what FlatStyle gcFontPicker is.
    gcFontPicker.DropDownSettings.UseSystemVisualStyle = true;

    gcFontPicker.DropDownSettings.Size = new Size(250, 300);

    // Initialize and set a shortcut menu for gcFontPicker's drop-down list.
    ContextMenuStrip myMenu = new ContextMenuStrip();
    myMenu.Items.Add("menu1");
    gcFontPicker.DropDownSettings.ContextMenuStrip = myMenu;

    // adds gcFontPicker to the form.
    this.Controls.Add(gcFontPicker);
}
Private Sub CreateGcFontPickerWithDropDownSettings()
    ' Create an instance of GcFontPicker control.
    Dim gcFontPicker As New GcFontPicker()

    ' Initialize the Name and Location of the gcFontPicker.
    gcFontPicker.Name = "gcFontPicker"
    gcFontPicker.Location = New Point(10, 50)

    ' Set some common properties on DropDownSettings.
    gcFontPicker.DropDownSettings.AutoDropDown = True
    gcFontPicker.DropDownSettings.AutoWidth = True
    gcFontPicker.DropDownSettings.DropDownDirection = Common.DropDownDirection.BelowRight
    gcFontPicker.DropDownSettings.OpeningAnimation = Common.DropDownAnimation.Extend
    gcFontPicker.DropDownSettings.ClosingAnimation = Common.DropDownAnimation.Extend
    gcFontPicker.DropDownSettings.AllowResize = False
    gcFontPicker.DropDownSettings.ShowShadow = False

    ' Set UseSystemVisualStyle to true, so that the drop-down list will be drawn by system
    ' no matter what FlatStyle gcFontPicker is.
    gcFontPicker.DropDownSettings.UseSystemVisualStyle = True

    gcFontPicker.DropDownSettings.Size = New Size(250, 300)

    ' Initialize and set a shortcut menu for gcFontPicker's drop-down list.
    Dim myMenu As New ContextMenuStrip()
    myMenu.Items.Add("menu1")
    gcFontPicker.DropDownSettings.ContextMenuStrip = myMenu

    ' adds gcFontPicker to the form.
    Me.Controls.Add(gcFontPicker)
End Sub
プラットフォーム

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

参照

FontPickerDropDownSettings クラス
FontPickerDropDownSettings メンバ

Send Feedback