DlgItem Function

Purpose

returns the handle of a Dialog item.

Syntax

h = DlgItem(DialogID,ItemID)

DialogID, ItemID:aexp
h:iexp

Description

If DialogID contains a number of a Dialog window previously opened with Dialog and ItemID is the number of a Dialog item DlgItem(DialogID,ItemID) returns the Windows handle of the item.

Example

Dialog # 1, 10, 10, 100, 150, "This is a Dialog", 128

PushButton "Ok", IDOK, 10, 10, 80, 20

PushButton "", IDCANCEL, 10, 30, 80, 20

LText "Cancel", 21, 10, 50, 80, 40

EndDialog

_Win$( DlgItem(1, IDCANCEL) ) = "Cancel"

_Win$( DlgItem(1, 21) ) = "Label"

ShowDialog # 1

Remarks

Dlg(DialogID,ItemID) is a shortcut for DlgItem(DialogID,ItemID) and can be used instead.

See Also

Dlg(), Dialog

{Created by Sjouke Hamstra; Last updated: 03/10/2014 by James Gaite}