ISDialog.AddControl

Description

This function adds the control to the dialog window.

Syntax

object.AddControl(ControlLabel, ControlType, DefaultValue)

Part Attribute Type Description
object Required
The object always implements the ISDialog interface
ControlLabel In, Required
string
The label text for the control
ControlType In, Required
The type of the control
DefaultValue In, Required
object
The default value

Return Value

ISControl

Returns the dialog window.

Example

Display the dialog window with data entering control. Show the result of its execution.

Dim aDialog
Dim aControl
Dim aResult
Dim aMessage

Set aDialog = Profile.CreateDialog("My Dialog")
set aControl = aDialog.AddControl("Enter Date", 0, DateAdd("d", -1, Now)) ' sctDateTime 
aResult = aDialog.Execute

if aResult then
  aMessage = "Ok button was pressed. "
else
  aMessage = "Cancel button was pressed. "
end if

aMessage = aMessage & vbNewLine & "Entered date value is " & aControl.Text

Profile.MsgBox(aMessage)                         
Note:

Version information

Added in v7.8.0