---
title: "Page (Generic)"
canonical: "https://docs.cuesystem.com/space/CVCGC/420315147/Page%20(Generic)"
format: markdown
---
> Macro (toc)

---

# Description

The Page is a basic object used as container for other objects. Page dimensions are automatically resized to fit the screen. That is why this object does not have functions for settings size and position. Backround of the Page can be any solid color or background picture set by property.

# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| NavigationBarButtonID | Long | 0 to maximum number of buttons in joined Navigation  
Bar | 0 | Value for joining Navigation Bars with page |
| Appearance |
| Color | Long | Any | _COLOR_GREY | Solid color of Page |
| Picture | AddressOf _Picture | Any | Nothing | Picture placed on the Page |
| PictureAlign | Long | Left-Top   
Left-Middle   
Left-Bottom   
Center-Top  
Center-Middle Center-Bottom   
Right-Top   
Right-Middle  
Right-Bottom | Center-Middle | Horizontal and vertical align of background picture |
| PictureFitting | Long | 0 = None  
2 = Fit Content to Object  
4 = Fit Content Proportionally  
5 = Fill Object Proportionally | 0 | Method of picture fitting |
| PictureOffsetX | Long | Any | 0 | Horizontal offset of picture in pixels. |
| PictureOffsetY | Long | Any | 0 | Vertical offset of picture in pixels. |

> 📝 ### Note
> 📝 
> 📝 NavigationBarButtonID is a property used for joining Page with the navigation bar. If the navigation bar has the same join as this Page and button with corresponding NavigationBarButtonID is pressed on navigation bar, this Page will open. If another button on navigation bar is pressed, this Page will close. If navigation bar has a different join, visibility of this Page is not managed by the navigation bar.

# Functions

## SetColor

This function sets background Color to newcolor value. See [CVC / Commands / Graphics](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881382) help for details, how to create long number representing required color. Function returns True.

#### Syntax

```visualbasic
Function SetColor(newcolor As Long) As Boolean
```

## GetColor

This function returns current background Color value.

#### Syntax

```visualbasic
Function GetColor() As Long
```

## SetPicture

This function sets background Picture to the newpicture. Function returns True.

#### Syntax

```visualbasic
Function SetPicture(newpicture As AddressOf _Picture) As Boolean
```

## GetPicture

This function returns AddressOf current background Picture.

#### Syntax

```visualbasic
Function GetPicture() As AddressOf _Picture
```

## SetPictureAlign

This function sets background PictureAlign to newpicturealign value. You can use meaningful BitOr combinations of following predefined constants for align

- PICTURE_ALIGNLEFT, PICTURE_ALIGNHCENTER, PICTURE_ALIGNRIGHT
- PICTURE_ALIGNTOP, PICTURE_ALIGNVCENTER, PICTURE_ALIGNBOTTOM

For example, if instance of Page is named Page1, you can use as parameter (Page1.PICTURE_ALIGNLEFT BitOr Page.PICTURE_ALIGNTOP) for left top align.

Function returns True on success or False if an error occurs (parameter has wrong value).

#### Syntax

```visualbasic
Function SetPictureAlign(newpicturealign As Long) As Boolean
```

## GetPictureAlign

This function returns current background PictureAlign value.

#### Syntax

```visualbasic
Function GetPictureAlign() As Long
```

## SetPictureFitting

This function sets fitting of Picture to newpicturefitting. You can use following predefined constants for fitting

- FITTING_NONE
- FITTING_FIT_CONTENT_TO_OBJECT
- FITTING_FIT_CONTENT_PROPORTIONALLY
- FITTING_FILL_OBJECT_PROPORTIONALLY

For example, if instance of PictureBox is named PictureBox1, you can use as parameter PictureBox1.FITTING_FIT_CONTENT_PROPORTIONALLY to fit content proportionally.

Function returns True on success or False if an error occurs (parameter has wrong value).

#### Syntax

```visualbasic
Function SetPictureFitting(newpicturefitting As Long) As Boolean
```

## GetPictureFitting

This function returns current PictureFitting.

#### Syntax

```visualbasic
Function GetPictureFitting() As Long
```

## SetPictureOffsetX

This function sets PictureOffsetX to newpictureoffsetx. Function returns True.

#### Syntax

```visualbasic
Function SetPictureOffsetX(newpictureoffsetx As Long) As Boolean
```

## GetPictureOffsetX

This function returns current PictureOffsetX.

#### Syntax

```visualbasic
Function GetPictureOffsetX() As Long
```

## SetPictureOffsetY

This function sets PictureOffsetY to newpictureoffsety. Function returns True.

#### Syntax

```visualbasic
Function SetPictureOffsetY(newpictureoffsety As Long) As Boolean
```

## GetPictureOffsetY

This function returns current PictureOffsetY.

#### Syntax

```visualbasic
Function GetPictureOffsetY() As Long
```

# Events

## OnHideObject

This event is raised whenever Page has been closed.

#### Syntax

```visualbasic
Event OnHideObject As Function()
```

## OnTouch

This event is generated when the Page is touched.

#### Syntax

```visualbasic
Event OnTouch As Process()
```

## OnShowObject

This event is raised whenever Page has been open.

#### Syntax

```visualbasic
Event OnShowObject As Function()
```