PowerTools MultiRow for Windows Forms 8.0J
Accelerations プロパティ
使用例 

NumericUpDownCellの並べ替え済み加速オブジェクトのコレクションを取得します。
構文
Public ReadOnly Property Accelerations As NumericUpDownAccelerationCollection
public NumericUpDownAccelerationCollection Accelerations {get;}

プロパティ値

NumericUpDownCellの並べ替え済み加速オブジェクトのコレクションを含むSystem.Windows.Forms.NumericUpDownAccelerationCollection
解説
MSDNのSystem.Windows.Forms.NumericUpDownコントロールを参照してください。
使用例
次のサンプルコードは、NumericUpDownCellの持ついくつかの重要なプロパティを示します。Column1では、Minimumは0で、Maximumは10です。編集モードに入ると、テキストが強調表示されます。上下左右の矢印キーを使用して値を増減できます。キーを1回押すと、値が0.01増減します。セルを選択すると、上下ボタンが表示されます。Column2では、値は16進数で表示され、初期値15は"F"と表示されます。上下ボタンは左揃えで配置され、テキスト全体を表示できない場合は中央に省略文字列が表示されます。このサンプルコードは、NumericUpDownCellに示されている詳細なコード例の一部を抜粋したものです。
private void Form1_Load(object sender, EventArgs e)
{
    NumericUpDownCell numericUpDownCell1 = new NumericUpDownCell();

    //The minimum value is 0, maximum value is 10, initial value is 0;
    numericUpDownCell1.Minimum = 0;
    numericUpDownCell1.Maximum = 10;
    numericUpDownCell1.Value = 0;
    //Use the Left, Right, Up, Down key to operate.
    numericUpDownCell1.InterceptArrowKeys = true;
    //Select one Cell, the SpinButton will display.
    numericUpDownCell1.ShowSpinButton = CellButtonVisibility.ShowForCurrentCell;
    numericUpDownCell1.DecimalPlaces = 2;
    //Press the arrow key, the value will increase 0.01
    numericUpDownCell1.Increment = 0.01m;
    //Enter edit mode ,the text will be highlight selected.
    numericUpDownCell1.HighlightText = true;

    NumericUpDownCell numericUpDownCell2 = new NumericUpDownCell();
    numericUpDownCell2.Value = 16m;
    //The value will display as hexadecimal.
    numericUpDownCell2.Hexadecimal = true;
    //The initial value is 15, it will display 'F'
    numericUpDownCell2.Value = 15;
    //The UpDown button will align to left.
    numericUpDownCell2.UpDownAlign = LeftRightAlignment.Left;
    //The thousand separator ',' will be inserted.
    numericUpDownCell2.ThousandsSeparator = true;
    //Press the Up or Down key all the time, after 2 seconds, the value will increase 50 once, after 6 seconds, 300 increased once.
    numericUpDownCell2.Accelerations.AddRange(new NumericUpDownAcceleration[] { new NumericUpDownAcceleration(2, 50), new NumericUpDownAcceleration(6, 300) });
    //If the value cannot be displayed completely, one ellipsis string will show in the middle.
    numericUpDownCell2.Ellipsis = MultiRowEllipsisMode.EllipsisPath;
    numericUpDownCell2.EllipsisString = "...";

    Template template1 = Template.CreateGridTemplate(new Cell[] { numericUpDownCell1, numericUpDownCell2 }, Int32.MaxValue,
        AutoGenerateGridTemplateStyles.ColumnHeader | AutoGenerateGridTemplateStyles.RowHeaderAutoNumber);
    template1.ColumnHeaders[0].Cells[0].Value = "Column1";
    template1.ColumnHeaders[0].Cells[1].Value = "Column2";

    gcMultiRow1.Template = template1;
    gcMultiRow1.RowCount = 10;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    Dim numericUpDownCell1 As New NumericUpDownCell()

    'The minimum value is 0, maximum value is 10, initial value is 0;
    numericUpDownCell1.Minimum = 0
    numericUpDownCell1.Maximum = 10
    numericUpDownCell1.Value = 0
    'Use the Left, Right, Up, Down key to operate.
    numericUpDownCell1.InterceptArrowKeys = True
    'Select one Cell, the SpinButton will display.
    numericUpDownCell1.ShowSpinButton = CellButtonVisibility.ShowForCurrentCell
    numericUpDownCell1.DecimalPlaces = 2
    'Press the arrow key, the value will increase 0.01
    numericUpDownCell1.Increment = 0.01D
    'Enter edit mode ,the text will be highlight selected.
    numericUpDownCell1.HighlightText = True

    Dim numericUpDownCell2 As New NumericUpDownCell()
    numericUpDownCell2.Value = 16D
    'The value will display as hexadecimal.
    numericUpDownCell2.Hexadecimal = True
    'The initial value is 15, it will display 'F'
    numericUpDownCell2.Value = 15
    'The UpDown button will align to left.
    numericUpDownCell2.UpDownAlign = LeftRightAlignment.Left
    'The thousand separator ',' will be inserted.
    numericUpDownCell2.ThousandsSeparator = True
    'Press the Up or Down key all the time, after 2 seconds, the value will increase 50 once, after 6 seconds, 300 increased once.
    numericUpDownCell2.Accelerations.AddRange(New NumericUpDownAcceleration() {New NumericUpDownAcceleration(2, 50), New NumericUpDownAcceleration(6, 300)})
    'If the value cannot be displayed completely, one ellipsis string will show in the middle.
    numericUpDownCell2.Ellipsis = MultiRowEllipsisMode.EllipsisPath
    numericUpDownCell2.EllipsisString = "..."

    Dim template1 As Template = Template.CreateGridTemplate(New Cell() {numericUpDownCell1, numericUpDownCell2})
    template1.ColumnHeaders(0).Cells(0).Value = "Column1"
    template1.ColumnHeaders(0).Cells(1).Value = "Column2"

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

NumericUpDownCell クラス
NumericUpDownCell メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.