---
title: "VerticalNavigationBar (Basic)"
canonical: "https://docs.cuesystem.com/space/CVCGC/402948143/VerticalNavigationBar%20(Basic)"
format: markdown
---
> Macro (toc)

---

# Description

VerticalNavigationBar is a window mainly used for navigation between different FullScreenWindows or MessageBoxes. It can have up to 100 text buttons. VerticalNavigationBar is automatically placed to the left right corner of the screen, width is automatically resized according resolution of touchpanel and height is custom selectable. That is why this object does not have functions for settings size and position.

![image](media://e54f02a4-6e39-4e57-9010-0dd3696cd5a6)

VerticalNavigationBar should be joined (by Join property) with FullScreenwindows or MessageBoxes. If some button on VerticalNavigationBar is pushed, FullScreenwindow with the same Join and corresponding NavigationBarButtonID has been open, windows with different NavigationBarButtonID have been closed. Windows with different Join are not affected.

If you need to place VerticalNavigationBar on a specific FullScrrenWindow, you can use events OnShowObject and OnHideObject of your FullScreenWindow for calling VerticalNavigationBar functions ShowObject and HideObject.

Button captions and number of buttons are defined by property ButtonCaptions - see picture below.

![image](media://e75b07ef-8d6c-49ed-839b-be7842155f93)

# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| DefaultButton | Long | 0 to Maximum number of used buttons in VerticalNavigationBar | 1 | Number of button activated upon initialization of VerticalNavigationBar |
| Appearance |
| NumberOfButtonsToDisplay | Long | 1 - 100 | 4 | Number of visible buttons. If VerticalNavigationBar has more items, navigation arrows are displayed, otherwise arrows are hidden. |
| ButtonCaptions | Text | Any | Nothing | Text list of captions displayed on buttons. Every caption must be on a separate line, see picture above. |
| Font | AddressOf _Font | Any | fntDefault16 | Items font. fntDefault16 is Verdana 16 pixels high. |
| LineSpacing | Double | Non-negative number | 1.2 | Vertical distance between two lines of multiline button caption. The value is multiple of the font height. |

# Functions

## SetSelectedButton

This function sets a selected button to newselectedbutton. Joined window with corresponding NavigationBarButtonID has been open, other joined windows have been closed. The function returns True on success or False if an error occurs (parameter is out of range).

#### Syntax

```visualbasic
Function SetSelectedButton(newselectedbutton As Long) As Boolean
```

## GetSelectedButton

This function returns current selected button of VerticalNavigationBar.

#### Syntax

```visualbasic
Function GetSelectedButton() As Long
```

# Events

## OnPress

This event is raised if some button on VerticalNavigationBar is pressed. Number of button is put to the parameter buttonid.

#### Syntax

```visualbasic
Event OnPress As Process(buttonid As Long)
```