Welcome
Contents of ctNavBar

  The ctNavBar object is a topic navigation control. The control is a sort of hybrid between a tree view control and a list bar control. It acts like a tree view in that it can contain a list of items and each item can contain a list of child items. However, it acts like a list bar control in that only one parent can be open at a time, and child items cannot contain child items themselves. The control is limited to two levels (topics and items).

Topics in the control can be opened in a variety of different ways. The first is to click on the arrow to the left of a topic. The next is to double click on the topic text itself. And the third is to use the SelectedTopic property.

File Names

Control File	: CTNAVBAR.OCX

License File 	: ctNavBar.lic

Class Name

CctNavBarCtrl

See Also :

Adding Items to the Control

Error Messages

Events

Methods

Properties

ctNavBar © 2001 DBI Technologies Inc.


Events

ctNavBar Event	Occurs
Click	Standard Event
CtrlError	Occurs when an error takes place within the control.
DblClick	Standard Event
FirstDraw	Occurs immediately after the control has been painted for the first time.
ItemClick	Occurs when an item in the list has been clicked on.
ItemDblClick	Occurs when an item in the control has been double clicked on.
ItemOver	Occurs when the mouse moves over a new item in the control.
ItemSelect	Occurs when a new item in the control has been selected.
KeyDown	Standard Event
KeyPress	Standard Event
KeyUp	Standard Event
MouseDown	Standard Event
MouseMove	Standard Event
MouseUp	Standard Event
RightClick	Occurs when the right mouse button clicks on the control.
TopicClick	Occurs when the left mouse button clicks on a topic line.
TopicDblClick	Occurs when the left mouse button double clicks on a topic line.


Methods

ctNavBar Method	Return Type	Description
AddItem	integer	Adds a new list item to a topic in the control.
AddTopic	integer	Adds a new topic to the control.
Clear	void	This method will remove all topic and topic items from the control.
ClearBackImage	void	Clears any picture image assigned to the BackImage property.
DeleteItem	boolean	This method deleted a single item from one of the topics in the control.
DeleteTopic	boolean	This method will delete a single topic and its associated items from the control.
ReDraw	void	Force the control to re-paint itself.


Properties

ctNavBar Property	Data Type	Description
ArrowColor	long	Specifies the color used to paint the topic navigation arrows.
AutoOpen	boolean	Specifies whether topic items will automatically open when they are selected.
BackColor	long	Specifies the default background color of the control.
BackImage	Picture	Specifies the bitmap or icon image used to tile the background of the list portion of the control.
BorderColor	long	Specifies the border color of the control.
BorderType	integer (enumerated)	Specifies the type of border to place around the control. Valid values include … • 0 - Regular • 1 - None • 2 - Raised • 3 - Lowered • 4 - Raised (Flat) • 5 - Lowered (Flat)
ControlWidth	integer	Specifies the virtual width of the control.
HeightOffset	integer	Specifies the offset value used to help calculate the height of each line in the control.
ImageXOffset	integer	Specifies the horizontal offset used to calculate the starting position of the BackImage property.
ImageYOffset	integer	Specifies the vertical offset used to calculate the starting position of the BackImage property.
ItemCargo	string	Specifies the internal text or cargo value for an item in a topic.
ItemCount	integer	Retrieves the number of items assigned to a particular topic.
ItemData	long	Specifies the internal data value for an item in a topic.
ItemFont	Font	Specifies the font used for the item lines within the control.
ItemFontOver	Font	Specifies the font used for the item lines within the control when the mouse moves over that line.
ItemForeColor	long	Specifies the color used to paint the text of lines within the control.
ItemIndent	integer	Specifies horizontal offset used to position the item text within the control.
ItemOverForeColor	long	Specifies the color used to paint the text of lines within the control when the mouse moves over the text.
ItemPicOver	Picture	Specifies an image used to place beside an item when the mouse moves over it.
ItemPicSelect	Picture	Specifies an image used to place beside a selected item.
ItemPicXOffset	integer	Specifies horizontal offset used to position the item pictures within the control.
ItemPicYOffset	integer	Specifies vertical offset used to position the item pictures within the control.
ItemSelectBackColor	long	Specifies the color used to paint the background of a selected text item.
ItemSelectForeColor	long	Specifies the color used to paint the text of a selected text item.
ItemText	string	Specifies the text for an item within the control.
MaskBitmap	boolean	Specifies whether to make bitmap pictures transparent or not.
MaskColor	long	Specifies the color used for transparency when using a transparent bitmap picture.
MouseIcon	Picture	Specifies the custom image used for the cursor when the mouse moves over the control.
MousePointer	integer (enumerated)	Specifies the mouse pointer to be used when the mouse is passing over the control.
NavPictureClose	Picture	Specifies an image used to place beside each topic item that is closed.
NavPictureOpen	Picture	Specifies an image used to place beside each topic item that is open.
NavPicXOffset	integer	Specifies horizontal offset used to position the navigational pictures within the control.
NavPicYOffset	integer	Specifies vertical offset used to position the navigational pictures within the control.
SelectedItem	integer	Specifies the currently selected item for a topic within the control.
SelectedTopic	integer	Specifies the currently selected topic within the control.
TextXOffset	integer	Specifies horizontal offset used to position the text within the control.
TextYOffset	integer	Specifies vertical offset used to position the text within the control.
TopicAsItem	boolean	Specifies a topic will behave in the same manner as an item.
TopicCargo	long	Specifies the internal text or cargo value for a topic.
TopicCount	integer	Retrieves the number of topics defined within the control.
TopicData	string	Specifies the internal data value for a topic.
TopicFont	Font	Specifies the font used for the main topic lines within the control.
TopicFontOver	Font	Specifies the font used for the main topic lines within the control when the mouse moves over that line.
TopicForeColor	long	Specifies the color used to paint the text of the main topic lines within the control.
TopicOverForeColor	long	Specifies the color used to paint the text of the main topic lines within the control when the mouse moves over the text.
TopicSelectBackColor	long	Specifies the color used to paint the background of a selected topic.
TopicSelectForeColor	long	Specifies the color used to paint the text of a selected topic.
TopicText	string	Specifies the text of a topic.


Adding Items to the Control

By default, The control is empty when it is first created. Unlike a list bar control, there is no default topic. To add new topics (level one items) to the control, we use the AddTopic method. For instance ...

nTopic = ctNavBar.AddTopic "Properties"

If the AddTopic method was successful, it will return the index value of its position. Topics and items start with an index value of 1. If the method returns a 0, it means the method was not successful. We can then use that index value and the AddItem method to add items to that topic. For instance…

ctNavBar.AddItem nTopic, "Item Text”


Error Messages

There are a variety of different errors that can be trapped when using this control. All error messages are sent directly to the CtrlError event and are sent as an integer value. These include …

32000 - No Memory : There is no longer any available memory to store new items.

32001 - Item Not Added : An attempt was made to add a new topic or item to the control, but was unable to do so.

32002 - Too Many Items : An attempt was made to add a topic or item past the 32000 item limit.

32003 - Bad Topic Index : An attempt was made to access a topic that is outside the range of the present control.

32004 - Bad Item Index : An attempt was made to access an item that is outside the range of the present items.


ArrowColor
ArrowColor Property

Description

Specifies the color used to paint the topic navigation arrows.

Syntax

[form.]ctNavBar.ArrowColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.ArrowColor = RGB( 128, 128, 128 )


AutoOpen
AutoOpen Property

Description

Specifies whether topic items will automatically open when they are selected. If this property is set to False, topics can only be opened by clicking on the topic button, double clicking on the topic, or pressing the <Enter> key when the topic is selected.

Syntax

[form.]ctNavBar.AutoOpen [= { True | False } ]

Data Type

Boolean

Example

ctNavBar.AutoOpen = True


BackColor
BackColor Property

Description

Specifies the default background color of the control.

Syntax

[form.]ctNavBar.BackColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.BackColor = RGB( 128, 128, 128 )


BackImage
BackImage Property

Description

Specifies the image used to paint the background of the control. If a back image is supplied, the background color will not be used.

If the size of the image is smaller than the area of the control, the image will be tiled so that it covers the entire area of the control.

In order to set the picture of the control, it must be either set using the picture property page of the control, the property table of the host language (if available), or by assigning a picture from another control to this one.

Syntax

[form.]ctNavBar.BackImage [ = Picture ]

Data Type

Picture

Example

ctNavBar.BackImage = OLE_Object.Picture


BorderColor
BorderColor Property

Description

Specifies the border color of the control.

Syntax

[form.]ctNavBar.BorderColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.BorderColor = RGB( 128, 128, 128 )


BorderType
BorderType Property

Description

Specifies the type of border to place around the control. Valid values include ...

•	0 - Regular	: Regular border

•	1 - None	: No border

•	2 - Raised	: Raised 3D border

•	3 - Lowered	: Lowered 3D border

•	4 - Raised (Flat)	: Thin raised border

•	5 - Lowered (Flat)	: Thin lowered border

Syntax

[form.]ctNavBar.BorderType [ = setting% ]

Data Type

Integer (enumerated)

Example

ctNavBar.BorderType = 2


ControlWidth
ControlWidth Property

Description

Specifies the virtual width of the control. If the value assigned to this property is greater than the actual width of the control, a horizontal scroll bar will appear at the bottom of the control.

Syntax

[form.]ctNavBar.ControlWidth [ = setting% ]

Data Type

Integer

Example

ctNavBar.ControlWidth = 100


HeightOffset
HeightOffset Property

Description

Specifies the offset value used to help calculate the height of each line in the control. The height of an item is based on the ItemFont and TopicFont property heights. This property can be used to increase or decrease this calculated height.

Syntax

[form.]ctNavBar.HeightOffset [ = setting% ]

Data Type

Integer

Example

ctNavBar.HeightOffset = 2


ImageXOffset
ImageXOffset Property

Description

Specifies the horizontal offset used to calculate the starting position of the BackImage property.

Syntax

[form.]ctNavBar.ImageXOffset [ = setting% ]

Data Type

Integer

Example

ctNavBar.ImageXOffset = 1


ImageYOffset
ImageYOffset Property

Description

Specifies the vertical offset used to calculate the starting position of the BackImage property.

Syntax

[form.]ctNavBar.ImageYOffset [ = setting% ]

Data Type

Integer

Example

ctNavBar.ImageYOffset = 1


ItemCargo
ItemCargo Property

Description

Specifies the internal text or cargo value for an item in a topic. A cargo value is only stored by an item. It will not appear anywhere on the control.

Syntax

[form.]ctNavBar.ItemCargo( topic%, item% ) [ = string% ]

Data Type

String

Parameters

•	1 - Topic	: (integer) The index value of the topic.

•	2 - Item	: (integer) The index value of the item.

•	3 - Text	: (string) The text for the item.

Example

ctNavBar.ItemCargo( 1, 3 ) = "ID Key:922881"


ItemCount
ItemCount Property

Description

Retrieves the number of items assigned to a particular topic. This is a read-only property.

Syntax

[form.]ctNavBar.ItemCount( nIndex )

Return Type

Integer : The amount it items assigned to the topic.

Parameters

•	1 - nIndex	: ( integer ) The index value of the topic

Example

nItems = ctNavBar.ItemCount(2)


ItemData
ItemData Property

Description

Specifies the internal data value for an item in a topic. A data value is only stored by an item. It will not appear anywhere on the control.

Syntax

[form.]ctNavBar.ItemData( topic%, item% ) [ = Value% ]

Data Type

Long

Parameters

•	1 - Topic	: (integer) The index value of the topic.

•	2 - Item	: (integer) The index value of the item.

•	3 - Data	: (long) The numeric data for the item.

Example

ctNavBar.ItemData( 1, 3 ) = 484767


ItemFont
ItemFont Property

Description

Specifies the font used for the item lines within the control.

In order to set the font of the control, it must be either set using the font property page of the control, the property table of the host language (if available), or by assigning a font from another control with the same font type to this one.

Syntax

[form.]ctNavBar.ItemFont [ = Font ]

Data Type

Font

Example

ctNavBar.ItemFont = lbl_Text.Font


ItemFontOver
ItemFontOver Property

Description

Specifies the font used for the item lines within the control when the mouse moves over that line.

In order to set the font of the control, it must be either set using the font property page of the control, the property table of the host language (if available), or by assigning a font from another control with the same font type to this one.

Syntax

[form.]ctNavBar.ItemFontOver [ = Font ]

Data Type

Font

Example

ctNavBar.ItemFontOver = lbl_Text.Font


ItemForeColor
ItemForeColor Property

Description

Specifies the color used to paint the text of lines within the control.

Syntax

[form.]ctNavBar.ItemForeColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.ItemForeColor = RGB( 128, 128, 128 )


ItemIndent
ItemIndent Property

Description

Specifies horizontal offset used to position the item text within the control. This is similar to the TextXOffset property except that it only applies to item text, and not topic text.

Syntax

[form.]ctNavBar.ItemIndent  [ = setting% ]

Data Type

Integer

Example

ctNavBar.ItemIndent = 2


ItemOverForeColor
ItemOverForeColor Property

Description

Specifies the color used to paint the text of lines within the control when the mouse moves over the text. If a value of -1 is assigned to this property, the property will be ignored.

Syntax

[form.]ctNavBar.ItemOverForeColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.ItemOverForeColor = RGB( 128, 128, 128 )


ItemPicOver
ItemPicOver Property

Description

Specifies an image used to place beside an item when the mouse moves over it.

Syntax

[form.]ctNavBar.ItemPicOver [ = Picture ]

Data Type

Picture

Example

ctNavBar.ItemPicOver = OLE_Object.Picture

 Note : For optimal results, the image supplied to this property should be 16x16 pixels in size.


ItemPicSelect
ItemPicSelect Property

Description

Specifies an image used to place beside a selected item.

Syntax

[form.]ctNavBar.ItemPicSelect [ = Picture ]

Data Type

Picture

Example

ctNavBar.ItemPicSelect = OLE_Object.Picture

 Note : For optimal results, the image supplied to this property should be 16x16 pixels in size.


ItemPicXOffset
ItemPicXOffset Property

Description

Specifies horizontal offset used to position the item pictures within the control.

Syntax

[form.]ctNavBar.ItemPicXOffset  [ = setting% ]

Data Type

Integer

Example

ctNavBar.ItemPicXOffset = 2


ItemPicYOffset
ItemPicYOffset Property

Description

Specifies vertical offset used to position the item pictures within the control.

Syntax

[form.]ctNavBar.ItemPicYOffset  [ = setting% ]

Data Type

Integer

Example

ctNavBar.ItemPicYOffset = 2


ItemSelectBackColor
ItemSelectBackColor Property

Description

Specifies the color used to paint the background of a selected text item. If a value of -1 is assigned to this property, the property will be ignored.

Syntax

[form.]ctNavBar.ItemSelectBackColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.ItemSelectBackColor = RGB( 128, 128, 128 )


ItemSelectForeColor
ItemSelectForeColor Property

Description

Specifies the color used to paint the text of a selected text item. If a value of -1 is assigned to this property, the property will be ignored.

Syntax

[form.]ctNavBar.ItemSelectForeColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.ItemSelectForeColor = RGB( 128, 128, 128 )


ItemText
ItemText Property

Description

Specifies the text for an item within the control.

Syntax

[form.]ctNavBar.ItemText( topic%, item% ) [ = string% ]

Data Type

String

Parameters

•	1 - Topic	: (integer) The index value of the topic.

•	2 - Item	: (integer) The index value of the item.

•	3 - Text	: (string) The text for the list item.

Example

ctNavBar.ItemText( 1, 3 ) = "New Items"


MaskBitmap
MaskBitmap Property

Description

Specifies whether to make bitmap pictures transparent or not. Transparent areas in a bitmap will be determined by the MaskColor property.

Syntax

[form.]ctNavBar.MaskBitmap [ = { True | False } ]

Data Type

Boolean

Example

ctNavBar.MaskBitmap = TRUE


MaskColor
MaskColor Property

Description

Specifies the color used for transparency when using a transparent bitmap picture. For example, if we set this property to a value of 255 (red), all red areas on the bitmap will show up as transparent.

Syntax

[form.]ctNavBar.MaskColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.MaskColor = RGB( 128, 128, 128 )


MouseIcon
MouseIcon Property

Description

Specifies the custom image used for the cursor when the mouse moves over the control. This property will only accept valid icon or cursor images. This property will not be used unless the MousePointer property is set to a value of 99 (custom).

Syntax

[form.]ctNavBar.MouseIcon [ = Picture ]

Data Type

Picture

Example

ctNavBar.MouseIcon = Icon.Picture


MousePointer
MousePointer Property

Description

Specifies the mouse pointer to be used when the mouse is passing over the control. Valid values include ...

•	0 - Default

•	1 - Arrow

•	2 - Cross

•	3 - Beam

•	4 - Icon

•	5 - Size

•	6 - Size NE SW

•	7 - Size NS

•	8 - Size NW SE

•	9 - Size WE

•	10 - Up Arrow

•	11 - Hourglass

•	12 - No Drop

•	13 - App Starting

•	14 - Question

•	15 - Size All

•	16 - Finger

•	99 - Custom

Syntax

[form.]ctNavBar.MousePointer [ = setting% ]

Data Type

Integer ( enumerated )

Example

ctNavBar.MousePointer = 2


NavPictureClose
NavPictureClose Property

Description

Specifies an image used to place beside each topic item that is closed.

Syntax

[form.]ctNavBar.NavPictureClose [ = Picture ]

Data Type

Picture

Example

ctNavBar.NavPictureClose = OLE_Object.Picture

 Note : For optimal results, the image supplied to this property should be 16x16 pixels in size.


NavPictureOpen
NavPictureOpen Property

Description

Specifies an image used to place beside each topic item that is open.

Syntax

[form.]ctNavBar.NavPictureOpen [ = Picture ]

Data Type

Picture

Example

ctNavBar.NavPictureOpen = OLE_Object.Picture

 Note : For optimal results, the image supplied to this property should be 16x16 pixels in size.


NavPicXOffset
NavPicXOffset Property

Description

Specifies horizontal offset used to position the navigational pictures within the control. This property only effects images in the NavPictureClose and NavPictureOpen properties, and not the stock images.

Syntax

[form.]ctNavBar.NavPicXOffset  [ = setting% ]

Data Type

Integer

Example

ctNavBar.NavPicXOffset = 2


NavPicYOffset
NavPicYOffset Property

Description

Specifies vertical offset used to position the navigational pictures within the control. This property only effects images in the NavPictureClose and NavPictureOpen properties, and not the stock images.

Syntax

[form.]ctNavBar.NavPicYOffset  [ = setting% ]

Data Type

Integer

Example

ctNavBar.NavPicYOffset = 2


SelectedItem
SelectedItem Property

Description

Specifies the currently selected item for a topic within the control. The value for this property most either equal 0 (no item is selected) or must fall within the range of available items for the selected topic.

Syntax

[form.]ctNavBar.SelectedItem  [ = setting% ]

Data Type

Integer

Example

ctNavBar.SelectedItem = 2


SelectedTopic
SelectedTopic Property

Description

Specifies the currently selected topic within the control.

Syntax

[form.]ctNavBar.SelectedTopic  [ = setting% ]

Data Type

Integer

Example

ctNavBar.SelectedTopic = 2


TextXOffset
TextXOffset Property

Description

Specifies horizontal offset used to position the text within the control.

Syntax

[form.]ctNavBar.TextXOffset  [ = setting% ]

Data Type

Integer

Example

ctNavBar.TextXOffset = 2


TextYOffset
TextYOffset Property

Description

Specifies vertical offset used to position the text within the control.

Syntax

[form.]ctNavBar.TextYOffset  [ = setting% ]

Data Type

Integer

Example

ctNavBar.TextYOffset = 2


TopicAsItem
TopicAsItem Property

Description

Specifies a topic will behave in the same manner as an item. When this property is set to False, clicking on a parent topic after a child item is selected will cause the child item to remain selected. If this property is set to True, clicking on a topic will cause the child item (if selected) to become un-selected. In other words, the topic item can be selected just like a regular item.

Syntax

[form.]ctNavBar.TopicAsItem [ = { True | False } ]

Data Type

Boolean

Example

ctNavBar.TopicAsItem = TRUE


TopicCargo
TopicCargo Property

Description

Specifies the internal text or cargo value for a topic. A cargo value is only stored by a topic. It will not appear anywhere on the control.

Syntax

[form.]ctNavBar.TopicCargo( topic% ) [ = string% ]

Data Type

String

Parameters

•	1 - Topic	: (integer) The index value of the topic.

•	2 - Text	: (string) The text for the topic.

Example

ctNavBar.TopicCargo( 1 ) = "ID Key:922881"


TopicCount
TopicCount Property

Description

Retrieves the number of topics defined within the control. This is a read-only property.

Syntax

[form.]ctNavBar.TopicCount( nIndex )

Return Type

Integer : The amount it topics defined within the control.

Example

nTopics = ctNavBar.TopicCount


TopicData
TopicData Property

Description

Specifies the internal data value for a topic. A data value is only stored by a topic. It will not appear anywhere on the control.

Syntax

[form.]ctNavBar.TopicData( topic%, item% ) [ = Value% ]

Data Type

Long

Parameters

•	1 - Topic	: (integer) The index value of the topic.

•	2 - Data	: (long) The numeric data for the topic.

Example

ctNavBar.TopicData( 1 ) = 484767


TopicFont
TopicFont Property

Description

Specifies the font used for the main topic lines within the control.

In order to set the font of the control, it must be either set using the font property page of the control, the property table of the host language (if available), or by assigning a font from another control with the same font type to this one.

Syntax

[form.]ctNavBar.TopicFont [ = Font ]

Data Type

Font

Example

ctNavBar.TopicFont = lbl_Text.Font


TopicFontOver
TopicFontOver Property

Description

Specifies the font used for the main topic lines within the control when the mouse moves over that line.

In order to set the font of the control, it must be either set using the font property page of the control, the property table of the host language (if available), or by assigning a font from another control with the same font type to this one.

Syntax

[form.]ctNavBar.TopicFontOver [ = Font ]

Data Type

Font

Example

ctNavBar.TopicFontOver = lbl_Text.Font


TopicForeColor
TopicForeColor Property

Description

Specifies the color used to paint the text of the main topic lines within the control.

Syntax

[form.]ctNavBar.TopicForeColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.TopicForeColor = RGB( 128, 128, 128 )


TopicOverForeColor
TopicOverForeColor Property

Description

Specifies the color used to paint the text of the main topic lines within the control when the mouse moves over the text. If a value of -1 is assigned to this property, the property will be ignored.

Syntax

[form.]ctNavBar.TopicOverForeColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.TopicOverForeColor = RGB( 128, 128, 128 )


TopicSelectBackColor
TopicSelectBackColor Property

Description

Specifies the color used to paint the background of a selected topic. If a value of -1 is assigned to this property, the property will be ignored.

Syntax

[form.]ctNavBar.TopicSelectBackColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.TopicSelectBackColor = RGB( 128, 128, 128 )


TopicSelectForeColor
TopicSelectForeColor Property

Description

Specifies the color used to paint the text of a selected topic. If a value of -1 is assigned to this property, the property will be ignored.

Syntax

[form.]ctNavBar.TopicSelectForeColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctNavBar.TopicSelectForeColor = RGB( 128, 128, 128 )


TopicText
TopicText Property

Description

Specifies the text of a topic.

Syntax

[form.]ctNavBar.TopicText( index% ) [ = string% ]

Data Type

String

Parameters

•	1 - Index	: (integer) The index value of the topic.

•	2 - Text	: (string) The text for the topic.

Example

ctNavBar.TopicText( nIndex ) = "New Items"


AddItem
AddItem Method

Description

This method adds a new list item to a topic in the control.

The value that is returned by this method indicates the new index value of the list item. If it returns a 0, the operation was not successful. See section on Adding Items to the Control for more information.

Syntax

[form.]ctNavBar.AddItem( nIndex, strText )

Return Type

Integer : The index value of the list item in the control after the it has been added.

Parameters

•	1 - nIndex	: ( integer ) The index value of the topic receiving the item

•	2 - strText	: ( string ) The text for the list item

Example

nItem = ctNavBar.AddItem 2, "General"


AddTopic
AddTopic Method

Description

This method adds a new topic to the control.

The value that is returned by this method indicates the new index value of the topic. If it returns a 0, the operation was not successful. This index value is required to add new items to a topic. See section on Adding Items to the Control for more information.

Syntax

[form.]ctNavBar.AddTopic( strText )

Return Type

Integer : The index value of the topic in the control after the insertion.

Parameters

•	1 - strText	: ( string ) The new text or title for the topic

Example

nTopic = ctNavBar.AddTopic("General")


Clear
Clear Method

Description

This method will remove all topic and topic items from the control.

Syntax

[form.]ctNavBar.Clear

Return Type

Void

Parameters

None

Example

ctNavBar.Clear


ClearBackImage
ClearBackImage Method

Description

This method clears any picture image assigned to the BackImage property.

Syntax

[form.]ctNavBar.ClearBackImage

Return Type

Void

Parameters

None

Example

ctNavBar.ClearBackImage


DeleteItem
DeleteItem Method

Description

This method deleted a single item from one of the topics in the control.

Syntax

[form.]ctNavBar.DeleteItem( nTopic, nItem )

Return Type

Boolean : Flag determining whether the deletion was successful.

Parameters

•	1 - nTopic	: ( integer ) The index value of the topic containing the item

•	2 - nItem	: ( integer ) The index value of the item being deleted

Example

bSuccess = ctNavBar.DeleteItem( 2, 3 )


DeleteTopic
DeleteTopic Method

Description

This method will delete a single topic and its associated items from the control.

Syntax

[form.]ctNavBar.DeleteTopic( nTopic )

Return Type

Boolean : Flag determining whether the deletion was successful.

Parameters

1 - nTopic	: (integer) The topic to be deleted

Example

bSuccess = ctNavBar.DeleteTopic(2)


ReDraw
ReDraw Method

Description

Force the control to re-paint itself. This control can also be used to ensure that the selected topic item is within the visible viewing area of the control.

Syntax

[form.]ctNavBar.ReDraw( {True | False} )

Return Type

void

Parameters

•	1 - ReDraw	: (boolean) Determines the re-draw method

Remarks

If a value of False is sent to this method, the control will only repaint itself. If a value of True is sent to it, it will adjust the top record so that the selected item is visible in the controls viewing area.

Example

ctNavBar.ReDraw True


CtrlError
CtrlError Event

Description

Occurs when an error takes place within the control.

Parameters

This event has two parameters sent to it. These include ...

•	1 - nError	( integer )	Error code used to identify the error

•	2 - nIndex	( integer )	Index value of where the error occurred

Note

See section on Error Messages for a list of possible errors that the control will report on.


FirstDraw
FirstDraw Event

Description

Occurs immediately after the control has been painted for the first time. This can be important because some properties base their data on how the control draws itself (i.e. font information). This data will not be accurate until the control draws itself at least once.

Parameters

None


ItemClick
ItemClick Event

Description

Occurs when an item in the control has been clicked on.

Parameters

This event has two parameters sent to it. These include ...

•	1 - nTopic	(integer)	Index value of the topic containing the item

•	2 - nItem	(integer)	Index value of the item being clicked


ItemDblClick
ItemDblClick Event

Description

Occurs when an item in the control has been double clicked on.

Parameters

This event has two parameters sent to it. These include ...

•	1 - nTopic	(integer)	Index value of the topic containing the item

•	2 - nItem	(integer)	Index value of the item being double clicked


ItemOver
ItemOver Event

Description

Occurs when the mouse moves over a topic or item in the control.

Parameters

This event has two parameters sent to it. These include ...

•	1 - nTopic	(integer)	Index value of the topic containing the item

•	2 - nItem	(integer)	Index value of the item being clicked


ItemSelect
ItemSelect Event

Description

Occurs when a new item in the control has been selected.

Parameters

This event has two parameters sent to it. These include ...

•	1 - nTopic	(integer)	Index value of the topic selected

•	2 - nItem	(integer)	Index value of the item selected

 Note : If the nItem parameter receives a value of 0, it means that only the topic was selected. None of the items within the topic were selected.


RightClick
RightClick Event

Description

Occurs when the right mouse button clicks on the control.

Parameters

This event has two parameters sent to it. These include ...

•	1 - nTopic	(integer)	Index value of the topic containing the item

•	2 - nItem	(integer)	Index value of the item being clicked


TopicClick
TopicClick Event

Description

Occurs when the left mouse button clicks on a topic line.

Parameters

This event has one parameter sent to it. It includes...

•	1 - nTopic	(integer)	Index value of the topic containing the item


TopicDblClick
TopicDblClick Event

Description

Occurs when the left mouse button double clicks on a topic line.

Parameters

This event has one parameter sent to it. It includes...

•	1 - nTopic	(integer)	Index value of the topic being double clicked