---
title: "BasicButtons Collection"
canonical: "https://docs.cuesystem.com/space/CVCGC/399769615/BasicButtons%20Collection"
format: markdown
---
> Macro (toc)

---

# Description

This graphic collection includes six different types of buttons. All these buttons have the same graphics and  
differ in their behavior. Buttons are arbitrarily resizable. If the size is too small, it is automatically changed to  
a reasonable minimum.

Buttons have three possible graphic states – State Up, State Down, and State Pushed (this state is displayed  
only while the button is pressed). Moreover, it is possible to disable a button. In this case, the button appears  
semi-transparent (see picture below for possible states). You can set different graphic looks for State Up and  
State Down (Pushed).

![image](media://b6148aa4-8c41-48a1-a565-ce7ebc18d7b3)

The following types of buttons are available

> Macro (children)

# Common Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| Enabled | Boolean | Any | True | Flag showing if a button is enabled or not. |
| Up |
| UpAlign | Long | Meaningfull BitOr combinations of _TEXT_ALIGN... constants | _TEXT_ ALIGNHCENTER BitOr _TEXT_ ALIGNVCENTER | Horizontal and vertical-align of UpText. See CVC help Commands/ BaseGraphicClass/DrawText for description of _TEXT_ALIGN... commands |
| UpButtonColor | Long | Any | Color (0, 0, 0, 0) | Color in which button is tinted in State Up. Opacity of color means intensity of color effect. Recommended value of color opacity is 20-60%. |
| UpFont | AddressOf<br>_Font | Any | fntDefault16 | CaptionUp text font. fntDefault16 is Verdana 16 pixels high. |
| UpFontColor | Long | Any | _COLOR_BLACK | Color of UpText |
| UpLineSpacing | Double | > 0 | 1.2 | The vertical distance between lines of UpText, measured from one line to the next. The value is a multiple of the font height. |
| UpPicture | AddressOf<br>_Picture | Any | Nothing | Picture placed to button in State Up. |
| UpPictureAlign | 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 UpPicture. |
| UpPictureOffsetX | Long | Any | 0 | Horizontal offset of UpPicture in pixels. |
| UpPictureOffsetY | Long | Any | 0 | Vertical offset of UpPicture in pixels. |
| UpText | AddressOf<br>Text | Any | “Caption” | Text shown on the button in State Up. |
| Down |
| DownAlign | Long | Meaningfull BitOr combinations of<br>_TEXT_ALIGN... constants | UpAlign | Horizontal and vertical align of DownText. See CVC help Commands/ BaseGraphicClass/DrawText for description of _TEXT_ALIGN... commands |
| DownButtonColor | Long | Any | UpButtonColor | Color in which button is tinted in State Down and State Pushed. Opacity of color means intensity of color effect. Recommended value of color opacity is 20-60%. |
| DownFont | AddressOf<br>_Font | Any | UpFont | CaptionDown text font. fntDefault16 is Verdana 16 pixels high. |
| DownFontColor | Long | Any | UpFontColor | Color of DownText |
| DownLineSpacing | Double | > 0 | UpLineSpacing | The vertical distance between lines of DownText, measured from one line to the next. The value is a multiple of the font height. |
| DownPicture | AddressOf<br>_Picture | Any | UpPicture | Picture placed to button in State Down. |
| DownPictureAlign | 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 DownPicture. |
| DownPictureOffsetX | Long | Any | 0 | Horizontal offset of DownPicture in pixels. |
| DownPictureOffsetY | Long | Any | 0 | Vertical offset of DownPicture in pixels. |
| DownText | AddressOf<br>Text | Any | UpText | Text shown on the button in State Down. |

# Common Functions

## Disable

This function sets button disabled. Function returns True.

#### Syntax

```visualbasic
Function Disable() As Boolean
```

## Enable

This function sets button enabled. Function returns True.

#### Syntax

```visualbasic
Function Enable() As Boolean
```

## IsEnabled 

This function returns True when the button is enabled and False when the button is disabled.

#### Syntax

```visualbasic
Function IsEnabled() As Boolean
```

## SetDownAlign

This function sets the align of DownText. You can use meaningful BitOr combinations of the following constants as a parameter:

- _TEXT_ALIGNLEFT
- _TEXT_ALIGNHCENTER
- _TEXT_ALIGNRIGHT
- _TEXT_ALIGNTOP
- _TEXT_ALIGNVCENTER
- _TEXT_ALIGNBOTTOM

The function returns True on success or False if an error occurs (i.e. parameter has wrong value).

#### Syntax

```visualbasic
Function SetDownAlign(newdownalign As Long) As Boolean
```

## GetDownAlign

This function returns the current align of DownText.

#### Syntax

```visualbasic
Function GetDownAlign() As Long
```

## SetDownButtonColor 

This function sets a new button color for State Down and State Pushed of button. Opacity of color means intensity of color effect. Recommended value is 20-60% . Function returns True.

#### Syntax

```visualbasic
Function SetDownButtonColor(newbuttoncolor As Long) As Boolean
```

## GetDownButtonColor

This function returns the current DownButtonColor.

#### Syntax

```visualbasic
Function GetDownButtonColor() As Long
```

## SetDownFont

This function sets the font of DownText. Function returns True.

#### Syntax

```visualbasic
Function SetDownFont(newdownfont As AddressOf _Font) As Boolean
```

## GetDownFont

This function returns addressof DownText font.

#### Syntax

```visualbasic
Function GetDownFont() As AddressOf _Font
```

## SetDownFontColor

This function sets a new DownText color. Function returns True.

#### Syntax

```visualbasic
Function SetDownFontColor(newfontcolor As Long) As Boolean
```

## GetDownFontColor

This function returns the current DownText color.

#### Syntax

```visualbasic
Function GetDownFontColor() As Long
```

## SetDownLineSpacing

This function sets line spacing of DownText. The function returns True on success or False if an error occurs (I.e. newuplinespacing < 0).

#### Syntax

```visualbasic
Function SetDownLineSpacing(newdownlinespacing As Double) As Boolean
```

## GetDownLineSpacing

This function returns the line spacing of DownText.

#### Syntax

```visualbasic
Function GetDownLineSpacing() As Double
```

## SetDownPicture 

This function sets a new button picture shown in State Down and State Pushed. Function returns True.

#### Syntax

```visualbasic
Function SetDownPicture(newdownpicture As AddressOf _Picture) As Boolean
```

## GetDownPicture

This function returns address of picture shown in State Down.

#### Syntax

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

## SetDownPictureAlign 

This function sets DownPicture align to newdownpicturealign value.

#### Syntax

```visualbasic
Function SetDownPictureAlign(newdownpicturealign As Long) As Boolean
```

## GetDownPictureAlign

This function returns the current align of DownPicture.

#### Syntax

```visualbasic
Function GetDownPictureAlign() As Long
```

## SetDownPictureOffsetX 

This function sets horizontal offset of DownPicture to newdownpictureoffsetx value.

#### Syntax

```visualbasic
Function SetDownPictureOffsetX(newdownpictureoffsetx As Long) As Boolean
```

## GetDownPictureOffsetX

This function returns the current horizontal offset of DownPicture.

#### Syntax

```visualbasic
Function GetDownPictureOffsetX() As Long
```

## SetDownPictureOffsetY

This function sets vertical offset of DownPicture to newdownpictureoffsety value.

#### Syntax

```visualbasic
Function SetDownPictureOffsetY(newdownpictureoffsety As Long) As Boolean
```

## GetDownPictureOffsetY

This function returns the current vertical offset of DownPicture.

#### Syntax

```visualbasic
Function GetDownPictureOffsetY() As Long
```

## SetDownText

This function sets current DownText to newdowntext. As newdowntext you can use direct value of text (SetDownText (“Hello”)). In this case you will lose the possibility of changing the language of this caption. You can also use addressof text (SetDownText (txtHello)) as parameter ( txtHello must be declared in MyCommon/ Text resources). In this case it is possible to change the language of the caption. Function returns True.

#### Syntax

```visualbasic
Function SetDownText(newdowntext as Text) As Boolean
```

## GetDownText

This function returns addressof the current DownText.

#### Syntax

```visualbasic
Function GetDownText() As AddressOf Text
```

## SetUpAlign 

This function sets align of UpText. You can use meaningful BitOr combinations of the following constants as parameters:

- _TEXT_ALIGNLEFT
- _TEXT_ALIGNHCENTER
- _TEXT_ALIGNRIGHT
- _TEXT_ALIGNTOP
- _TEXT_ALIGNVCENTER
- _TEXT_ALIGNBOTTOM

The function returns True on success or False if an error occurs (i.e. parameter has wrong value).

#### Syntax

```visualbasic
Function SetUpAlign(newupalign As Long) As Boolean
```

## GetUpAlign 

This function returns the current align of UpText.

#### Syntax

```visualbasic
Function GetUpAlign() As Long
```

## SetUpButtonColor 

This function sets a new button color for State Up of button. Opacity of color means intensity of color effect. Recommended value is 20-60% . Function returns True.

#### Syntax

```visualbasic
Function SetUpButtonColor(newbuttoncolor As Long) As Boolean
```

## GetUpButtonColor 

This function returns the current UpButtonColor.

#### Syntax

```visualbasic
Function GetUpButtonColor() As Long
```

## SetUpFont

This function sets the font of UpText. Function returns True.

#### Syntax

```visualbasic
Function SetUpFont(newupfont As AddressOf _Font) As Boolean
```

## GetUpFont 

This function returns addressof UpText font.

#### Syntax

```visualbasic
Function GetUpFont() As AddressOf _Font
```

## SetUpFontColor 

This function sets new UpText color. Function returns True.

#### Syntax

```visualbasic
Function SetUpFontColor(newfontcolor As Long) As Boolean
```

## GetUpFontColor

This function returns the current UpText color.

#### Syntax

```visualbasic
Function GetUpFontColor() As Long
```

## SetUpLineSpacing

This function sets line spacing of UpText. The function returns True on success or False if an error occurs (I.e. newuplinespacing < 0).

#### Syntax

```visualbasic
Function SetUpLineSpacing(newuplinespacing As Double) As Boolean
```

## GetUpLineSpacing

This function returns line spacing of UpText.

#### Syntax

```visualbasic
Function GetUpLineSpacing() As Double
```

## SetUpPicture

This function sets a new button picture shown in State Up. Function returns True.

#### Syntax

```visualbasic
Function SetUpPicture(newuppicture As AddressOf _Picture) As Boolean
```

## GetUpPicture

This function returns address of picture shown in State Up.

#### Syntax

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

## SetUpPictureAlign 

This function sets UpPicture align to newuppicturealign value.

#### Syntax

```visualbasic
Function SetUpPictureAlign(newuppicturealign As Long) As Boolean
```

## GetUpPictureAlign

This function returns the current align of UpPicture.

#### Syntax

```visualbasic
Function GetUpPictureAlign() As Long
```

## SetUpPictureOffsetX

This function sets horizontal offset of UpPicture to newuppictureoffsetx value.

#### Syntax

```visualbasic
Function SetUpPictureOffsetX(newuppictureoffsetx As Long) As Boolean
```

## GetUpPictureOffsetX

This function returns the current horizontal offset of UpPicture.

#### Syntax

```visualbasic
Function GetUpPictureOffsetX() As Long
```

## SetUpPictureOffsetY

This function sets vertical offset of UpPicture to newuppictureoffsety value.

#### Syntax

```visualbasic
Function SetUpPictureOffsetY(newuppictureoffsety As Long) As Boolean
```

## GetUpPictureOffsetY

This function returns the current vertical offset of UpPicture.

#### Syntax

```visualbasic
Function GetUpPictureOffsetY() As Long
```

## SetUpText 

This function sets the current UpText to newuptext. As newuptext you can use the direct value of text (SetUpText (“Hello”)). In this case you will lose the possibility of changing the language of this caption. You can also use addressof text (SetUpText (txtHello)) as parameter ( txtHello must be declared in MyCommon/ Text resources). In this case it is possible to change the language of the caption. Function returns True.

#### Syntax

```visualbasic
Function SetUpText(newuptext as Text) As Boolean
```

## GetUpText

This function returns addressof the current UpText.

#### Syntax

```visualbasic
Function GetUpText() As AddressOf Text
```