GrapeCity.Win.MultiRow Namespace > TrackBarCell Class : SmallChange Property |
<SRCategoryAttribute("Appearance")> <DefaultValueAttribute()> <SRDescriptionAttribute("Indicates a value to be added to or subtracted from the value property when the scroll box is moved a small distance.")> Public Property SmallChange As Integer
Dim instance As TrackBarCell Dim value As Integer instance.SmallChange = value value = instance.SmallChange
[SRCategory("Appearance")] [DefaultValue()] [SRDescription("Indicates a value to be added to or subtracted from the value property when the scroll box is moved a small distance.")] public int SmallChange {get; set;}
Exception | Description |
---|---|
System.ArgumentOutOfRangeException | The specified value is less than 0. |
When the user presses one of the arrow keys, the Cell.Value property changes according to the value set in the SmallChange property.
Consider setting the SmallChange value to a percentage of the Cell.Height (for a vertically oriented track bar) or Cell.Width (for a horizontally oriented track bar) value. This keeps the distance your track bar moves proportionate to its size.
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 is 20. trackBarCell1.Maximum = 20; //When the slider is dragged to the bottom, the Cell.FormattedValue is 10. trackBarCell1.Minimum = 10; //Press the Up or Down key, 2 positions are moved. trackBarCell1.SmallChange = 2; //Click on the track bar, 5 positions are moved. trackBarCell1.LargeChange = 5; //Between each tick mark, there are 2 positions. trackBarCell1.TickFrequency = 2; TrackBarCell trackBarCell2 = trackBarCell1.Clone() as TrackBarCell; //Track bar has a 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 is 20. trackBarCell1.Maximum = 20 'When the slider is dragged to the bottom, the Cell.FormattedValue is 10. trackBarCell1.Minimum = 10 'Press the Up or Down key, 2 positions are moved. trackBarCell1.SmallChange = 2 'Click on the track bar, 5 positions are moved. trackBarCell1.LargeChange = 5 'Between each tick mark, there are 2 positions. trackBarCell1.TickFrequency = 2 Dim trackBarCell2 = TryCast(trackBarCell1.Clone(), TrackBarCell) 'Track bar has a 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
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