Skip to content

IsKey Property

Description

Returns whether this is a Block or Key.

Property Type

Read-only property

Syntax (Visual Basic)

Public Property IsKey() As Boolean

Return Type

Returns True if this is a Key, False if this is a Block.

Remarks

IsKey will tell if the TrackBlock object represents a Block or Key.

The TrackBlock object is used to represent both Blocks and Keys.

Track Blocks are a visual representation of units of time in a track. They can have both a minimum and maximum time period. For example, a given block can represent 25 units of time, but can no less than 15 and no more than 30 units of time.

Dim TrackItem As TrackControlItem  
Dim Block As TrackBlock  

Set TrackItem = TrackControl.CreateTrackItem  
Record.AddItemEx(TrackItem)  

Set Block = TrackItem.AddBlock(False, 15, 25)  
Block.MinLength = 15  
Block.MaxLength = 30  
Block.Color = RGB(255, 219, 117)

The code above adds a block that represents 25 time units. It is placed within the track at 15 time units. Also note that the first parameter of AddBlock is False, which indicates we are adding a block as opposed to a key.

Blocks can also be different heights and set to different vertical alignments within the track. This is used just as a visual aid to make different blocks in the track visually different from each other.

Block.HeightPercent = 0.5

The code above simply makes the block 50% the size of the track height.

Keys are used simply as "notes" or reference points in the track. They can be added anywhere in the track to make note of some event at the given moment in time.

TrackItem.AddBlock(True, 70, 0)

The code above will add a key at time unit 70; the last parameter, size, is ignored when adding keys. Note that the first parameter is True, which tells AddBlock to add a key as opposed to a block.

See Also

TrackBlock Object


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