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

GcFontPickerコントロールのドロップダウン設定を取得します。
構文
Public ReadOnly Property DropDownSettings As FontPickerDropDownSettings
public FontPickerDropDownSettings DropDownSettings {get;}

プロパティ値

GcFontPickerのドロップダウン設定を表すFontPickerDropDownSettings
解説
DropDownSettingsを使用して、GcFontPickerのドロップダウンリストの外観や動作をカスタマイズできます。
使用例

次のサンプルコードは、DropDownSettingsプロパティを使用してフォントドロップダウンリストをカスタマイズする方法を示します。このサンプルコードを実行するには、以下のコードを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

参照

GcFontPicker クラス
GcFontPicker メンバ
FontPickerDropDownSettings クラス
FontPickerDropDownSettings クラス

Send Feedback