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

セルに描画する目盛の間隔を指定する値を取得または設定します。
構文
Public Property TickFrequency As Integer
public int TickFrequency {get; set;}

プロパティ値

セルに描画する目盛の間隔を指定する値を表すSystem.Int32値。既定値は1です。
解説
MinimumプロパティとMaximumプロパティ間の値の範囲が大きいTrackBarCellでは、セルの値に対応する目盛をすべて描画するのは実際的ではありません。たとえば、セルの値の範囲が100の場合にこのプロパティの値を5に設定すると、20個の目盛がセルに描画されます。この場合、個々の目盛は値の範囲の5単位を表します。
使用例
次のサンプルコードは、垂直のTrackBarCellを示します。Minimumは10で、Maximumは20です。[↑]または[↓]キーを押すと、2刻みで移動します。トラックバーをクリックすると、5刻みで移動します。目盛の間隔は2です。このサンプルコードは、TrackBarCellに示されている詳細なコード例の一部を抜粋したものです。
private void Form1_Load(object sender, EventArgs e)
{
    TrackBarCell trackBarCell1 = new TrackBarCell();
    trackBarCell1.Size = new Size(80, 80);
    //When the slider is dragged to the top, the Cell.FormattedValue will be 20.
    trackBarCell1.Maximum = 20;
    //When the slider is dragged to the bottom, the Cell.FormattedValue will be 10.
    trackBarCell1.Minimum = 10;
    //Press the Up or Down key, 2 positions will be moved.
    trackBarCell1.SmallChange = 2;
    //Click on  the track bar, 5 positions will be moved.
    trackBarCell1.LargeChange = 5;
    //Between each tick mark, there exists 2 positions.
    trackBarCell1.TickFrequency = 2;

    TrackBarCell trackBarCell2 = trackBarCell1.Clone() as TrackBarCell;
    //Track bar will be lay out at vertical orientation.
    trackBarCell2.Orientation = Orientation.Vertical;
    trackBarCell2.TickStyle = TickStyle.Both;

    Template template1 = Template.CreateGridTemplate(new Cell[] { trackBarCell1, trackBarCell2 });

    gcMultiRow1.Template = template1;
    gcMultiRow1.RowCount = 3;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    Dim trackBarCell1 As New TrackBarCell()
    trackBarCell1.Size = New Size(80, 80)
    'When the slider is dragged to the top, the Cell.FormattedValue will be 20.
    trackBarCell1.Maximum = 20
    'When the slider is dragged to the bottom, the Cell.FormattedValue will be 10.
    trackBarCell1.Minimum = 10
    'Press the Up or Down key, 2 positions will be moved.
    trackBarCell1.SmallChange = 2
    'Click on  the track bar, 5 positions will be moved.
    trackBarCell1.LargeChange = 5
    'Between each tick mark, there exists 2 positions.
    trackBarCell1.TickFrequency = 2

    Dim trackBarCell2 = TryCast(trackBarCell1.Clone(), TrackBarCell)

    'Track bar will be lay out at vertical orientation.
    trackBarCell2.Orientation = Orientation.Vertical
    trackBarCell2.TickStyle = TickStyle.Both

    Dim template1 As Template = Template.CreateGridTemplate(New Cell() {trackBarCell1, trackBarCell2})

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

TrackBarCell クラス
TrackBarCell メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.