Skip to content

CreateTrackItem Method

Description

Creates a TrackControlItem (Track) that can be added to the Track Control.

Syntax

Public Function CreateTrackItem() As [TrackControlItem](XtremeGridControl~TrackControlItem.md)

Return Type

Reference to a new TrackControlItem.

Remarks

The Track Control uses a special item type called a TrackControlItem. This item is used to hold blocks and keys. CreateTrackItem will create a new TrackControlItem that can be added to a GridRecord using the AddItemEx method. Once the TrackControlItem is added to the GridRecord, it will be displayed in the Track Control.

The following applies to adding tracks to a record:

  • Tracks are what hold the blocks and keys.
  • A track is a special item that is added to a regular GridRecord.
Dim TrackItem As TrackControlItem  
Dim Record As GridRecord  
Dim Block As TrackBlock  

Set Record = TrackControl.Records.Add  

Record.AddItem 1  
Record.AddItem 1  
Record.AddItem 1  

Set TrackItem = TrackControl.CreateTrackItem  
Record.AddItemEx TrackItem  
Set Block = TrackItem.AddBlock(False, 15, 25)

The code above adds a track to the track control. It adds 3 normal items, then it adds a TrackControlItem. You must first create a track item before you can use it using the CreateTrackItem method. Once it is created, you can then add this new track item to the record using AddItemEx. This will add your track so you can then add blocks and keys.

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.