PowerTools MultiRow for Windows Forms 8.0J
FlatStyle プロパティ (HeaderCell)
使用例 

ボタンの外観のスタイルを取得または設定します。
構文
Public Property FlatStyle As FlatStyle
public FlatStyle FlatStyle {get; set;}

プロパティ値

System.Windows.Forms.FlatStyle値の1つ。既定値はSystem.Windows.Forms.FlatStyle.Systemです。
例外
例外解説
System.ComponentModel.InvalidEnumArgumentException指定された値がSystem.Windows.Forms.FlatStyle値の1つではありません。
使用例
次のサンプルコードは、RowHeaderCellのフラット効果を示します。このRowHeaderCellの外観は、FlatAppearanceを使用して描画されます。このサンプルコードは、RowHeaderCellクラスに示されている詳細なコード例の一部を抜粋したものです。
private void Form1_Load(object sender, EventArgs e)
{
    Template template1 = Template.CreateGridTemplate(10, 80, 21, Int32.MaxValue, AutoGenerateGridTemplateStyles.RowHeader, 50);
    //Set this property, one error icon glyph will be displayed on the RowHeaderCell, if RowHeaderCell.ShowRowError is false, no icon shown.
    template1.Row.ErrorText = "Row Error";

    RowHeaderCell rowHeaderCell1 = template1.Row.Cells[10] as RowHeaderCell;
    //Click the RowHeaderCell, the current row will be selected.
    rowHeaderCell1.SelectionMode = MultiRowSelectionMode.Row;
    //Set FlatStyle to Flat, and customize some appearances.
    rowHeaderCell1.FlatStyle = FlatStyle.Flat;
    rowHeaderCell1.FlatAppearance.BorderColor = Color.Black;
    rowHeaderCell1.FlatAppearance.BorderSize = 1;
    rowHeaderCell1.FlatAppearance.MouseDownBackColor = Color.Khaki;
    rowHeaderCell1.FlatAppearance.MouseOverBackColor = Color.Orange;

    rowHeaderCell1.Style.BackColor = Color.DarkKhaki;
    rowHeaderCell1.Style.SelectionBackColor = Color.LightBlue;

    //The editing icon and new row icon will not display.
    rowHeaderCell1.ShowIndicator = false;
    //Set ShowRowError to false to hide the row's error icon.
    rowHeaderCell1.ShowRowError = false;
    //Set the RowHeaderCell's caption. it will display "A1, A2, A3, ...".
    rowHeaderCell1.ValueFormat = "A1";

    gcMultiRow1.Template = template1;
    gcMultiRow1.RowCount = 100;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    Dim template1 As Template = Template.CreateGridTemplate(10, 80, 21, Int32.MaxValue, AutoGenerateGridTemplateStyles.RowHeader, 50)
    'Set this property, one error icon glyph will be displayed on the RowHeaderCell, if RowHeaderCell.ShowRowError is false, no icon shown.
    template1.Row.ErrorText = "Row Error"

    Dim rowHeaderCell1 As RowHeaderCell = TryCast(template1.Row.Cells(10), RowHeaderCell)
    'Click the RowHeaderCell, the current row will be selected.
    rowHeaderCell1.SelectionMode = MultiRowSelectionMode.Row
    'Set FlatStyle to Flat, and customize some appearances.
    rowHeaderCell1.FlatStyle = FlatStyle.Flat
    rowHeaderCell1.FlatAppearance.BorderColor = Color.Black
    rowHeaderCell1.FlatAppearance.BorderSize = 1
    rowHeaderCell1.FlatAppearance.MouseDownBackColor = Color.Khaki
    rowHeaderCell1.FlatAppearance.MouseOverBackColor = Color.Orange

    rowHeaderCell1.Style.BackColor = Color.DarkKhaki
    rowHeaderCell1.Style.SelectionBackColor = Color.LightBlue

    'The editing icon and new row icon will not display.
    rowHeaderCell1.ShowIndicator = False
    'Set ShowRowError to false to hide the row's error icon.
    rowHeaderCell1.ShowRowError = False
    'Set the RowHeaderCell's caption. it will display "A1, A2, A3, ...".
    rowHeaderCell1.ValueFormat = "A1"

    gcMultiRow1.Template = template1
    gcMultiRow1.RowCount = 100
End Sub
参照

HeaderCell クラス
HeaderCell メンバ
FlatAppearance プロパティ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.