GrapeCity.Win.MultiRow.v80 アセンブリ > GrapeCity.Win.MultiRow 名前空間 > TrackBarCell クラス : SmallChange プロパティ |
例外 | 解説 |
---|---|
System.ArgumentOutOfRangeException | 指定された値が0未満です。 |
ユーザーがいずれかの矢印キーを押すと、SmallChangeプロパティに設定された値に従って、Cell.Valueプロパティが変更されます。
SmallChangeの値をCell.Height(トラックバーが垂直方向の場合)またはCell.Width(トラックバーが水平方向の場合)の値の割合に設定できます。そうすると、トラックバーの移動量が常にそのサイズに対して比例した量になります。
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