GrapeCity.Win.Pickers 名前空間 > ColorPickerDropDownSettings クラス : AutoDropDown プロパティ |
次のサンプルコードは、GcColorPicker.DropDownSettingsプロパティ上でAutoDropDownプロパティをtrueに設定して、GcColorPickerのドロップダウンウィンドウの自動ドロップダウンを有効にします。この例を実行するには、以下のコードをSystem.Windows.Forms.Formに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出す必要があります。
private void CreateGcColorPickerWithDropDownSettings() { // Create an instance of GcColorPicker control. GcColorPicker gcColorPicker = new GcColorPicker(); // Initialize the Name and Location of the gcColorPicker. gcColorPicker.Name = "gcColorPicker"; gcColorPicker.Location = new Point(10, 50); // Custom the drop-down settings for gcColorPicker. gcColorPicker.DropDownSettings.AutoDropDown = true; gcColorPicker.DropDownSettings.ShowShadow = false; gcColorPicker.DropDownSettings.OpeningAnimation = GrapeCity.Win.Common.DropDownAnimation.Extend; gcColorPicker.DropDownSettings.ClosingAnimation = GrapeCity.Win.Common.DropDownAnimation.Extend; gcColorPicker.DropDownSettings.DropDownDirection = GrapeCity.Win.Common.DropDownDirection.BelowLeft; // Initialize and set a shortcut menu for gcColorPicker's drop-down window. ContextMenuStrip myMenu = new ContextMenuStrip(); myMenu.Items.Add("menu1"); gcColorPicker.DropDownSettings.ContextMenuStrip = myMenu; // adds gcColorPicker to the form. this.Controls.Add(gcColorPicker); }
Private Sub CreateGcColorPickerWithDropDownSettings() ' Create an instance of GcColorPicker control. Dim gcColorPicker As New GcColorPicker() ' Initialize the Name and Location of the gcColorPicker. gcColorPicker.Name = "gcColorPicker" gcColorPicker.Location = New Point(10, 50) ' Custom the drop-down settings for gcColorPicker. gcColorPicker.DropDownSettings.AutoDropDown = True gcColorPicker.DropDownSettings.ShowShadow = False gcColorPicker.DropDownSettings.OpeningAnimation = DropDownAnimation.Extend gcColorPicker.DropDownSettings.ClosingAnimation = DropDownAnimation.Extend gcColorPicker.DropDownSettings.DropDownDirection = DropDownDirection.BelowLeft ' Initialize and set a shortcut menu for gcColorPicker's drop-down window. Dim myMenu As New ContextMenuStrip() myMenu.Items.Add("menu1") gcColorPicker.DropDownSettings.ContextMenuStrip = myMenu ' adds gcColorPicker to the form. Me.Controls.Add(gcColorPicker) 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