Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/Reference/Modules/AmbientProperties/BackColor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: BackColor
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/BackColor
---
# BackColor
{: .no_toc }

Returns the background colour the container would like its embedded controls to use by default, as an **stdole.OLE_COLOR**. Read-only.

Syntax: *object*.**BackColor**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

A control that does not have its own background colour explicitly set should paint its background using this colour, so that it blends in with the surrounding container. The value is an **OLE_COLOR**: an RGB value, a system-colour reference, or a palette-index reference. Pass it through [**TranslateColor**](../../../Modules/Information/TranslateColor) to obtain a plain RGB value if needed.

### See Also

- [ForeColor](ForeColor) property
- [Font](Font) property
- [Palette](Palette) property
22 changes: 22 additions & 0 deletions docs/Reference/Modules/AmbientProperties/DisplayAsDefault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: DisplayAsDefault
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/DisplayAsDefault
---
# DisplayAsDefault
{: .no_toc }

Returns whether the container is treating this control as its default control, as a **Boolean**. Read-only.

Syntax: *object*.**DisplayAsDefault**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

The default control on a form is the one activated when the user presses **Enter** without first giving focus to another control — most often a command button. A control that wants to advertise its default-button status should paint itself with the heavier border or other distinguishing visual when **DisplayAsDefault** is **True**.

### See Also

- [ShowGrabHandles](ShowGrabHandles) property
- [ShowHatching](ShowHatching) property
- [SupportsMnemonics](SupportsMnemonics) property
21 changes: 21 additions & 0 deletions docs/Reference/Modules/AmbientProperties/DisplayName.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: DisplayName
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/DisplayName
---
# DisplayName
{: .no_toc }

Returns the name the container has assigned to the control, as a **String**. Read-only.

Syntax: *object*.**DisplayName**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

The host typically returns the name by which the user identifies the control — for example `"Form1!Command1"` in a designer, or whatever label has been chosen at run time. A control can include this string in error messages, log entries, or property browsers so that the user can tell which instance the message refers to.

### See Also

- [LocaleID](LocaleID) property
- [UserMode](UserMode) property
22 changes: 22 additions & 0 deletions docs/Reference/Modules/AmbientProperties/Font.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Font
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/Font
---
# Font
{: .no_toc }

Returns the font the container would like its embedded controls to use by default, as an **stdole.IFontDisp**. Read-only.

Syntax: *object*.**Font**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

A control that does not have its own font explicitly set should display text using this font, so that its captions and labels match the typography of the surrounding container. The returned **IFontDisp** exposes properties such as **Name**, **Size**, **Bold**, **Italic**, and **Underline**.

### See Also

- [BackColor](BackColor) property
- [ForeColor](ForeColor) property
- [TextAlign](TextAlign) property
22 changes: 22 additions & 0 deletions docs/Reference/Modules/AmbientProperties/ForeColor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: ForeColor
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/ForeColor
---
# ForeColor
{: .no_toc }

Returns the foreground colour the container would like its embedded controls to use by default, as an **stdole.OLE_COLOR**. Read-only.

Syntax: *object*.**ForeColor**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

A control that does not have its own foreground colour explicitly set should draw its text and other foreground elements using this colour, so that it remains legible against the container's [**BackColor**](BackColor). The value is an **OLE_COLOR**: an RGB value, a system-colour reference, or a palette-index reference. Pass it through [**TranslateColor**](../../../Modules/Information/TranslateColor) to obtain a plain RGB value if needed.

### See Also

- [BackColor](BackColor) property
- [Font](Font) property
- [Palette](Palette) property
21 changes: 21 additions & 0 deletions docs/Reference/Modules/AmbientProperties/LocaleID.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: LocaleID
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/LocaleID
---
# LocaleID
{: .no_toc }

Returns the Locale ID of the container, as a **Long**. Read-only.

Syntax: *object*.**LocaleID**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

The Locale ID (LCID) is a 32-bit Windows identifier that names a language and a regional formatting convention — for example `&H0409&` for English (United States) or `&H0407&` for German (Germany). A control should use this value when formatting numbers, dates, currencies, and message text, so that its output matches the language and conventions the host application is presenting to the user.

### See Also

- [DisplayName](DisplayName) property
- [RightToLeft](RightToLeft) property
21 changes: 21 additions & 0 deletions docs/Reference/Modules/AmbientProperties/MessageReflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: MessageReflect
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/MessageReflect
---
# MessageReflect
{: .no_toc }

Returns whether the container reflects window messages back to the control, as a **Boolean**. Read-only.

Syntax: *object*.**MessageReflect**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

Some Windows notification messages — such as **WM_COMMAND**, **WM_NOTIFY**, and the **WM_CTLCOLOR\*** family — are by default delivered to the parent window of the control that produced them. When **MessageReflect** is **True**, the container reflects those notifications back to the control's own window procedure as **OCM_\*** messages, so the control can handle them itself; when **False**, the container handles them and the control will not see them.

### See Also

- [SupportsMnemonics](SupportsMnemonics) property
- [UserMode](UserMode) property
21 changes: 21 additions & 0 deletions docs/Reference/Modules/AmbientProperties/Palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Palette
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/Palette
---
# Palette
{: .no_toc }

Returns the colour palette the container would like its embedded controls to draw with, as an **stdole.IPictureDisp**. Read-only.

Syntax: *object*.**Palette**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

The returned object is a picture whose attached palette identifies the colours the host expects to be available. A control rendering on a palette-managed display should use these colours to avoid unwanted palette flashing when its window receives the focus. On modern true-colour displays the palette is rarely meaningful, and most controls can ignore it.

### See Also

- [BackColor](BackColor) property
- [ForeColor](ForeColor) property
21 changes: 21 additions & 0 deletions docs/Reference/Modules/AmbientProperties/RightToLeft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: RightToLeft
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/RightToLeft
---
# RightToLeft
{: .no_toc }

Returns whether the container is laid out for a right-to-left language, as a **Boolean**. Read-only.

Syntax: *object*.**RightToLeft**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

The property is **True** when the host is rendering its UI for a right-to-left language such as Arabic or Hebrew, and **False** for left-to-right languages. A control that displays text or directional adornments (scrollbars, tree expanders, alignment defaults) should mirror its layout when this is **True** so that it reads naturally inside an RTL container.

### See Also

- [LocaleID](LocaleID) property
- [TextAlign](TextAlign) property
21 changes: 21 additions & 0 deletions docs/Reference/Modules/AmbientProperties/ScaleUnits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: ScaleUnits
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/ScaleUnits
---
# ScaleUnits
{: .no_toc }

Returns a localised name for the unit of measure the container uses to size itself, as a **String**. Read-only.

Syntax: *object*.**ScaleUnits**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

Common values include `"Twip"`, `"Pixel"`, `"Inch"`, `"Centimeter"`, `"Millimeter"`, `"Point"`, and `"Character"`, but the container is free to return any string and to localise it for the current language. The value is a hint for display purposes — for example, in a status bar or a property sheet — and not a fixed enumeration that should be parsed.

### See Also

- [LocaleID](LocaleID) property
- [TextAlign](TextAlign) property
22 changes: 22 additions & 0 deletions docs/Reference/Modules/AmbientProperties/ShowGrabHandles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: ShowGrabHandles
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/ShowGrabHandles
---
# ShowGrabHandles
{: .no_toc }

Returns whether the container would like the control to draw selection grab handles, as a **Boolean**. Read-only.

Syntax: *object*.**ShowGrabHandles**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

Grab handles are the small squares drawn on the corners and edges of a selected control on a designer surface. A simple control can leave the grab handles to the host and ignore this property; a control that paints its own selection feedback (for example, because it occupies its full client area) should draw them when **ShowGrabHandles** is **True**. The property is generally only meaningful while [**UserMode**](UserMode) is **False**.

### See Also

- [ShowHatching](ShowHatching) property
- [UserMode](UserMode) property
- [DisplayAsDefault](DisplayAsDefault) property
22 changes: 22 additions & 0 deletions docs/Reference/Modules/AmbientProperties/ShowHatching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: ShowHatching
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/ShowHatching
---
# ShowHatching
{: .no_toc }

Returns whether the container would like the control to draw a selection hatching pattern, as a **Boolean**. Read-only.

Syntax: *object*.**ShowHatching**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

Selection hatching is the diagonal cross-hatch the IDE draws over an inactive embedded object to make clear it is selected but not yet activated for editing. A control that paints its own selection feedback should overlay a hatching pattern when this property is **True**. As with [**ShowGrabHandles**](ShowGrabHandles), the property is generally only meaningful while [**UserMode**](UserMode) is **False**.

### See Also

- [ShowGrabHandles](ShowGrabHandles) property
- [UserMode](UserMode) property
- [DisplayAsDefault](DisplayAsDefault) property
21 changes: 21 additions & 0 deletions docs/Reference/Modules/AmbientProperties/SupportsMnemonics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: SupportsMnemonics
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/SupportsMnemonics
---
# SupportsMnemonics
{: .no_toc }

Returns whether the container will dispatch keyboard mnemonics to embedded controls, as a **Boolean**. Read-only.

Syntax: *object*.**SupportsMnemonics**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

A mnemonic is the underlined letter in a caption such as `&File` — it gives the user a way to invoke the control with **Alt+F**. When **SupportsMnemonics** is **True**, the container forwards mnemonic keystrokes to the control; the control should then underline its mnemonic letter when displaying the caption. When the property is **False**, the host will not forward mnemonics, and the control should display its caption without underlining.

### See Also

- [DisplayAsDefault](DisplayAsDefault) property
- [MessageReflect](MessageReflect) property
30 changes: 30 additions & 0 deletions docs/Reference/Modules/AmbientProperties/TextAlign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: TextAlign
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/TextAlign
---
# TextAlign
{: .no_toc }

Returns the container's preferred text alignment, as an **Integer**. Read-only.

Syntax: *object*.**TextAlign**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

A control that displays text and does not have its own alignment explicitly set should align its text according to this hint. The value follows the standard OLE control alignment enumeration:

| Value | Meaning |
|-------|--------------------------------------------------------|
| 0 | General — numeric values right-aligned, text left-aligned |
| 1 | Left-aligned |
| 2 | Centred |
| 3 | Right-aligned |
| 4 | Fill |

### See Also

- [Font](Font) property
- [RightToLeft](RightToLeft) property
- [ScaleUnits](ScaleUnits) property
20 changes: 20 additions & 0 deletions docs/Reference/Modules/AmbientProperties/UIDead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: UIDead
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/UIDead
---
# UIDead
{: .no_toc }

Returns whether the user interface is currently non-responsive, as a **Boolean**. Read-only.

Syntax: *object*.**UIDead**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

The host sets **UIDead** to **True** when the application is in a state where it cannot meaningfully respond to user input — most commonly while execution is paused inside the debugger, but also during long modal operations. While **UIDead** is **True** a control should suppress animations, hover effects, and any input it would otherwise process, since the host's main thread cannot deliver a useful follow-up.

### See Also

- [UserMode](UserMode) property
23 changes: 23 additions & 0 deletions docs/Reference/Modules/AmbientProperties/UserMode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: UserMode
parent: AmbientProperties Module
permalink: /tB/Packages/VBRUN/AmbientProperties/UserMode
---
# UserMode
{: .no_toc }

Returns whether the control is running inside an application (**True**) or being edited inside a designer (**False**), as a **Boolean**. Read-only.

Syntax: *object*.**UserMode**

*object*
: *required* An object expression that evaluates to an **AmbientProperties** object.

This is the most-checked ambient property. A control should consult **UserMode** before doing anything that only makes sense at run time — connecting to a database, starting a timer, animating its own appearance — because at design time the host is showing a static representation of the control on a layout surface. When **UserMode** is **False**, the control should also be willing to draw selection adornments such as [**ShowGrabHandles**](ShowGrabHandles) and [**ShowHatching**](ShowHatching) on request.

### See Also

- [UIDead](UIDead) property
- [ShowGrabHandles](ShowGrabHandles) property
- [ShowHatching](ShowHatching) property
- [DisplayAsDefault](DisplayAsDefault) property
Loading