Create  Button

The Create function creates dynamically the control window that will be a child window of the specified dialog window.

The Create function should be used by advanced users only.

The Button object can use the following styles:

See http://msdn.microsoft.com

Syntax

Integer Button.Create(
     Dialog dlg,
     Rectangle rect,
     String caption = "",
     String style = "WS_VISIBLE",
     String exStyle = "")

Parameters

dlgDialog of the control.Required
rectRelative dialog position of the control.Required
captionCaption of the control.Optional
styleWindows API Styles of the control (each style must be separated by a space).Optional
exStyleWindows API Extended Styles of the control (each style must be separated by a space).Optional

Return value

The Create function returns true.

If an error occurs, the Create function returns false.

Example

object Application
{
    Dialog m_dlg new
    Button m_ctrl new
}
function Application.Constructor()
{
    Rectangle rc new
    m_dlg.LoadResource("dialog.dlg"this)
    rc.Set(10, 10, 100, 25)
    m_ctrl.Create(m_dlg, rc, "OK""WS_VISIBLE BS_DEFPUSHBUTTON")
}
function Application.Destructor()
{
    m_ctrl.Destroy()
    m_dlg.Close()
}
message Integer Application.Dialog.OnDestroy()
{
    QuitApplication()
    return OK
}
SECCIA Documentation - Copyright © 2001-2009 Sylvain Seccia