_hFont Function

Purpose

Returns the handle of the font currently selected in the active Form (OpenW, Dialog, Form)

Syntax

x = _hFont

x : Handle

Description

Using _hFont the handle of the current font of the current active window can be obtained. It could then be used to set the font of some custom, non-OCX, control using WM_SETFONT.

In case of a Form, OpenW, ChildW, and ParentW the _hFont returns the handle of a StdFont object. When this font object is destroyed the font handle is no longer valid.

Example

OpenW 1

AutoRedraw = 1

Print _hFont

Print Me.Font._hFont

Do

Sleep

Until Me Is Nothing

Remarks

_hFont is a shortcut for Me.Font._hFont.

See Also

Font, Font To, SetFont, GetFont, RFont, Dlg Font, _font$, _font$=, FreeFont, DelFont

{Created by Sjouke Hamstra; Last updated: 04/07/2023 by James Gaite; Other Contributors: Jean-Marie Melanson}