GrapeCity MultiRow Windows Forms Documentation
TickFrequency Property
Example 


Gets or sets a value that specifies the delta between ticks drawn on the cell.
Syntax
<SRDescriptionAttribute("Indicates a value that specifies the delta between ticks drawn on the cell.")>
<DefaultValueAttribute()>
<SRCategoryAttribute("Appearance")>
Public Property TickFrequency As Integer
Dim instance As TrackBarCell
Dim value As Integer
 
instance.TickFrequency = value
 
value = instance.TickFrequency
[SRDescription("Indicates a value that specifies the delta between ticks drawn on the cell.")]
[DefaultValue()]
[SRCategory("Appearance")]
public int TickFrequency {get; set;}

Property Value

A System.Int32 value that represents a value that specifies the delta between ticks drawn on the cell. The default is 1.
Remarks
For a TrackBarCell with a large range of values between the Minimum and the Maximum properties, it might be impractical to draw all the ticks for values on the cell. For example, if you have a cell with a range of 100, passing in a value of 5 here causes the cell to draw 20 ticks. In this case, each tick represents five units in the range of values.
Example
The following code example shows a vertical TrackBarCell. The Minimum is 10 and the Maximum is 20. Press the up arrow or down arrow key and the bar moves two positions. Click the track bar and it moves five positions. There are two positions between each tick mark. This example is part of a larger example available for the TrackBarCell class.
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
Requirements

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

See Also

Reference

TrackBarCell Class
TrackBarCell Members

 

 


Copyright © GrapeCity, inc. All rights reserved.