GrapeCity.Win.Pickers 名前空間 > GcColorPicker クラス : DropDownSettings プロパティ |
Public ReadOnly Property DropDownSettings As ColorPickerDropDownSettings
public ColorPickerDropDownSettings DropDownSettings {get;}
次のサンプルコードは、DropDownSettingsプロパティを使用して色ドロップダウンウィンドウをカスタマイズする方法を示します。このサンプルコードを実行するには、以下のコードを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