GrapeCity.Win.Pickers 名前空間 > FontPickerDropDownSettings クラス : AutoDropDown プロパティ |
次のサンプルコードは、GcFontPicker.DropDownSettingsプロパティ上でAutoDropDownプロパティをtrueに設定して、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