PowerTools PlusPak for Windows Forms 8.0J
ButtonPosition 列挙体
使用例 使用例 

関連付けられたピッカーコントロールにサイドボタンを配置する位置を指定します。
構文
Public Enum ButtonPosition 
   Inherits System.Enum
public enum ButtonPosition : System.Enum 
メンバ
メンバ解説
LeftInsideボタンは、境界線の左内側に配置されます。
LeftOutsideボタンは、境界線の左外側に配置されます。
RightInsideボタンは、境界線の右内側に配置されます。
RightOutsideボタンは、境界線の右外側に配置されます。
解説
この列挙体を使用して、サイドボタンの位置を、関連付けられたピッカーコントロールの左境界線または右境界線の内側または外側に設定できます。この列挙体は、SideButtonBase.Positionプロパティで使用されます。
使用例
次のサンプルコードは、SideButtonを作成し、そのSideButtonBase.PositionプロパティをButtonPosition.RightOutSideに設定します。このサンプルコードは、GrapeCity.Win.Containers.GcComboFrameクラスの概要に示されている詳細なコード例の一部を抜粋したものです。その元の例では、最初にcomboBox1からSideButton項目を選択してgcComboFrame1にSideButtonを表示できます。
// Returns a SideButton instance for gcComboFrame1.
private SideButtonBase CreateSideButton()
{
    SideButton sideButton = new SideButton();

    // Specify a unique name for this button.
    sideButton.Name = "SideButton";

    // Set button text.
    sideButton.Text = "Add a item";

    // Set button's width.
    sideButton.ButtonWidth = 70;

    // Set this side button not to show in GcComboFrame.
    sideButton.Visible = ButtonVisibility.NotShown;

    // Set this side button to position at outside of GcComboFrame's right border.
    sideButton.Position = ButtonPosition.RightOutside;

    // Set the fat appearance for this button, and these settings will take effect when 
    // its associated GcComboFrame's FlatStyle is Flat.
    sideButton.FlatAppearance.BorderColor = Color.Red;
    sideButton.FlatAppearance.BorderSize = 2;
    sideButton.FlatAppearance.CheckedBackColor = Color.Blue;
    sideButton.FlatAppearance.MouseDownBackColor = Color.Yellow;
    sideButton.FlatAppearance.MouseOverBackColor = Color.Green;

    sideButton.Click += new EventHandler(SideButton_Click);

    return sideButton;
}

// Add a item into listBox1 when SideButton is clicked.
private void SideButton_Click(object sender, EventArgs e)
{
    if (this.textBox1.Text != string.Empty)
    {
        this.listBox1.Items.Add(this.textBox1.Text);
        this.textBox1.Clear();
    }
    else
    {
        MessageBox.Show("You must input a string first !");
    }
}
' Returns a SideButton instance for gcComboFrame1.
Private Function CreateSideButton() As SideButtonBase
    Dim sideButton As New SideButton()

    ' Specify a unique name for this button.
    sideButton.Name = "SideButton"

    ' Set button text.
    sideButton.Text = "Add a item"

    ' Set button's width.
    sideButton.ButtonWidth = 70

    ' Set this side button not to show in GcComboFrame.
    sideButton.Visible = ButtonVisibility.NotShown

    ' Set this side button to position at outside of GcComboFrame's right border.
    sideButton.Position = ButtonPosition.RightOutside

    ' Set the fat appearance for this button, and these settings will take effect when 
    ' its associated GcComboFrame's FlatStyle is Flat.
    sideButton.FlatAppearance.BorderColor = Color.Red
    sideButton.FlatAppearance.BorderSize = 2
    sideButton.FlatAppearance.CheckedBackColor = Color.Blue
    sideButton.FlatAppearance.MouseDownBackColor = Color.Yellow
    sideButton.FlatAppearance.MouseOverBackColor = Color.Green

    AddHandler sideButton.Click, AddressOf SideButton_Click

    Return sideButton
End Function

' Add a item into listBox1 when SideButton is clicked.
Private Sub SideButton_Click(ByVal sender As Object, ByVal e As EventArgs)
    If Me.textBox1.Text <> String.Empty Then
        Me.listBox1.Items.Add(Me.textBox1.Text)
        Me.textBox1.Clear()
    Else
        MessageBox.Show("You must input a string first !")
    End If
End Sub
継承階層

System.Object
   System.ValueType
      System.Enum
         GrapeCity.Win.Common.ButtonPosition

プラットフォーム

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

参照

GrapeCity.Win.Common 名前空間
Position プロパティ

Send Feedback