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

---

# Description

The FloatingWindow is a basic object used as container for other objects. Backround of the FloatingWindow can be any solid color or background picture set by property.

Open modes are as follows

- Modal - window is a child window that requires users to interact with it before they can return to operating the parent application, thus preventing the workflow on the application main window. Modal windows are often used to display a dialog box.
- Modeless - window that stays active/visible on the screen until explicitly dismissed. A good way to display announcements or other content that demand attention.
- Topmost - window is placed above all other windows.


# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| OpenMode | Long | Modal Modeless<br>Topmost | Topmost | It is the method of the window activation. |
| 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. |

# Functions

## SetColor

This function sets background Color to newcolor value. See [CVC / Commands / Graphics help](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881382) 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
```

## SetOpenMode

This function sets OpenMode to newopenmode. You can use following constants as parameter

- _OW_MODAL for Modal open mode
- _OW_TOPMOST for Topmost open mode
- 0 for Modeless open mode

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

#### Syntax

```visualbasic
Function SetOpenMode(newopenmode As Long) As Boolean
```

## GetOpenMode

This function returns current OpenMode of the window.Syntax

```visualbasic
Function GetOpenMode() As Long
```

# Events

## OnHideObject 

This event is raised whenever FloatingWindow has been closed.

#### Syntax

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

## OnTouch 

This event is generated when the FloatingWindow is touched.

#### Syntax

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

## OnShowObject 

This event is raised whenever FloatingWindow has been open.

#### Syntax

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