Form Interface Reference

The Form is a top level frame. More...

Inheritance diagram for Form:

Inheritance graph
Collaboration diagram for Form:

Collaboration graph
List of all members.

Public Member Functions

 Minimize (void)
 This method minimizes the form.
 Restore (void)
 This method activates and displays the form.
 Maximize (void)
 This method maximizes the form.
 Close (void)
 This method closes the form.
 ShowModal (void)
 This method shows the form as a modal form.
 MessageBox ([in] BSTR Text,[in, defaultvalue("")] BSTR Caption,[in, defaultvalue(0)] LONG Flags,[out, retval] LONG *pResult)
 This function creates, displays, and operates a standard message box dialog.
 ColorDialog ([in, defaultvalue(0x00FFFFFF)] ULONG StartColor,[in, defaultvalue(CC_DEFAULT)] ULONG Flags,[out, retval] ULONG *pColor)
 This method creates, display, and operates a standard color dialog box that enables the user to select a color.
 FontDialog ([in] IDispatch *StartValue,[in, defaultvalue(CF_DEFAULT)] ULONG Flags,[out, retval] IDispatch **pResult)
 This method creates, display, and operates a standard font dialog box that enables the user to select a font.
 OpenDialog ([in] BSTR DefaultExt,[in] BSTR Filter,[in, defaultvalue("")] BSTR StartFile,[in, defaultvalue(OFN_OPENDEFAULT)] ULONG Flags,[out, retval] BSTR *pFileName)
 This method creates, display, and operates an standard file open dialog box that enables the user specify the drive, directory, and the name of a file or the names of set of files to open.
 SaveDialog ([in] BSTR DefaultExt,[in] BSTR Filter,[in, defaultvalue("")] BSTR StartFile,[in, defaultvalue(OFN_SAVEDEFAULT)] ULONG Flags,[out, retval] BSTR *pFileName)
 This method creates, display, and operates an standard file save dialog box that enables the user specify the drive, directory, and the name of a file or the names of set of files to save.
 SelectFolderDialog ([in] BSTR Title,[in, defaultvalue(BIF_DEFAULT)] ULONG Flags,[out, retval] BSTR *pFolder)
 This method creates, display, and operates an standard Folder selection dialog box that enables the user specify the folder.
 PrintDialog ([in, defaultvalue(PD_DEFAULT)] ULONG Flags,[in, defaultvalue(0)] USHORT MinPage,[in, defaultvalue(0)] USHORT MaxPage,[out, retval] IDispatch **pResult)
 This method creates, display, and operates an standard Print dialog box that enables the user specify the printer parameters.
 PrinterSetupDialog ([in, defaultvalue(PD_DEFAULT)] ULONG Flags,[out, retval] IDispatch **pResult)
 This method creates, display, and operates an standard Print setup dialog box that enables the user specify the printer parameters.
 PageSetupDialog ([in, defaultvalue(PSD_DEFAULT)] ULONG Flags,[out, retval] IDispatch **pResult)
 This method creates, display, and operates an standard Page setup dialog box.
 CreateFindDialog ([in, defaultvalue("")] BSTR FindText,[in, defaultvalue(FR_DOWN)] ULONG Flags,[out, retval] IDispatch **pResult)
 This method creates a system-defined Find dialog box.
 CreateReplaceDialog ([in, defaultvalue("")] BSTR FindText,[in, defaultvalue("")] BSTR ReplaceText,[in, defaultvalue(FR_DOWN)] ULONG Flags,[out, retval] IDispatch **pResult)
 This method creates a system-defined Find & Replace dialog box that lets the user specify a string to search for and a replacement string.
 CreateFontDialog ([out, retval] IDispatch **pResult)
 This method creates a standard font dialog box that enables the user to select a font.
 CreateColorDialog ([out, retval] IDispatch **pResult)
 This method creates a standard color dialog box that enables the user to select a color.
 CreateOpenDialog ([out, retval] IDispatch **pResult)
 This method creates a standard file open dialog box that enables the user specify the drive, directory, and the name of a file or the names of set of files to open.
 CreateSaveDialog ([out, retval] IDispatch **pResult)
 This method creates a standard file save dialog box that enables the user specify the drive, directory, and the name of a file or the names of set of files to save.
 CreateSelectFolderDialog ([out, retval] IDispatch **pResult)
 This method creates a standard Folder selection dialog box that enables the user specify the folder.
 CreateForm ([in] LONG Left,[in] LONG Top,[in] LONG Width,[in] LONG Height,[in, defaultvalue(WS_DEFAULT)] LONG Style,[out, retval] IDispatch **pControl)
 This method creates an child form.
 CreateDialogForm ([in] LONG Left,[in] LONG Top,[in] LONG Width,[in] LONG Height,[in, defaultvalue(WS_DIALOGDEFAULT)] LONG Style,[out, retval] IDispatch **pControl)
 This method creates an dialog form.

Properties

VARIANT W Icon []
 Sets the file name for the Icon of the form.
IDispatch *RW Menu []
 Gets or sets the menu of the form.
VARIANT_BOOL RW KeyPreview []
 This property controls when the keyboard event OnKeyUp, OnKeyDown occurs on the form.
VARIANT_BOOL RW MaximizeBox []
 The MaximizeBox property is a Boolean value that indicates that the form has a maximize button.
VARIANT_BOOL RW MinimizeBox []
 The MinimizeBox property is a Boolean value that indicates that the form has a minimize button.
VARIANT_BOOL RW ControlBox []
 The ControlBox property is a Boolean value that indicates that the form has a window menu and buttons on its title bar.
VARIANT_BOOL RW SizeGrip []
 The SizeGrip property is a Boolean value that indicates that the form has a sizing border.
VARIANT_BOOL RW TopMost []
 The TopMost property is a Boolean value that indicates that the form is a topmost form.
VARIANT_BOOL RW ToolWindow []
 The SizeGrip property is a Boolean value that indicates that the form is a tool window.
VARIANT_BOOL RW Caption []
 The SizeGrip property is a Boolean value that indicates that the form has a title bar.
IDispatch *RW AcceptButton []
 Gets or sets the Accept button.
IDispatch *RW CancelButton []
 Gets or sets the Cancel button.
IDispatch *RW HelpButton []
 Gets or sets the Help button.
IDispatch *RW ActiveControl []
 Gets or sets the control that has focus on the form.
VARIANT_BOOL RW CanClose []
 The CanClose property is a Boolean value that indicates that the form can be closed.
ULONG W Region []
 Gets or sets the region.
IDispatch *R TaskBar []
 Gets the TaskBar object for the form.
VARIANT_BOOL RW Active []
 "TRUE" if the form is active.
VARIANT_BOOL RW Foreground []
 "TRUE" if the form is the foreground window.
VARIANT W OnCloseQuery []
 Sets the event handler for the OnCloseQuery event.
VARIANT W OnClose []
 Sets the event handler for the OnClose event.
VARIANT W OnActiveControlChange []
 Sets the event handler for the OnActiveControlChange event.
VARIANT W OnHitTest []
 Sets the event handler for the OnHitTest event.
VARIANT W OnHint []
 Sets the event handler for the OnHint event.
VARIANT W OnMinimize []
 Sets the event handler for the OnMinimize event.
VARIANT W OnMaximize []
 Sets the event handler for the OnMaximize event.
VARIANT W OnRestore []
 Sets the event handler for the OnRestore event.
VARIANT W OnCopyData []
 Sets the event handler for the OnCopyData event.
VARIANT W OnActivate []
 Sets the event handler for the OnActivate event.
VARIANT W OnEnterSizeMove []
 Sets the event handler for the OnEnterSizeMove event.
VARIANT W OnExitSizeMove []
 Sets the event handler for the OnExitSizeMove event.

Detailed Description

The Form is a top level frame.

An Form can have a title bar, a menu bar, the window menu, the close button, the minimize button, the maximize button, the restore button, a sizing border.

See also FormEvents.


Member Function Documentation

Close ( void   ) 

This method closes the form.

ColorDialog ( [in, defaultvalue(0x00FFFFFF)] ULONG  StartColor,
[in, defaultvalue(CC_DEFAULT)] ULONG  Flags,
[out, retval] ULONG *  pColor 
)

This method creates, display, and operates a standard color dialog box that enables the user to select a color.

Parameters:
StartColor The start color for the dialog
Flags The Flags for the dialog. This parameter can be a combination of the following values: CC_FULLOPEN, CC_PREVENTFULLOPEN, CC_SHOWHELP, CC_SOLIDCOLOR, CC_ANYCOLOR
Return values:
pColor The user's selected color

CreateColorDialog ( [out, retval] IDispatch **  pResult  ) 

This method creates a standard color dialog box that enables the user to select a color.

Return values:
pResult The ColorDialog object.
Since:
1.1.5.

CreateDialogForm ( [in] LONG  Left,
[in] LONG  Top,
[in] LONG  Width,
[in] LONG  Height,
[in, defaultvalue(WS_DIALOGDEFAULT)] LONG  Style,
[out, retval] IDispatch **  pControl 
)

This method creates an dialog form.

Parameters:
Left Specifies the initial horizontal position of the child form
Top Specifies the initial vertical position of the child form
Width Specifies the width of the child form
Height Specifies the height of the child form
Style Specifies the style of the window. This parameter can be a combination of the following values: WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, WS_MAXIMIZEBOX, WS_SIZEBOX, WS_THICKFRAME, WS_SIZEGRIP, WS_SIZEBOX, WS_CONTROLBOX, WS_SYSMENU.
Return values:
pControl Form object.
See also CreateForm method.

CreateFindDialog ( [in, defaultvalue("")] BSTR  FindText,
[in, defaultvalue(FR_DOWN)] ULONG  Flags,
[out, retval] IDispatch **  pResult 
)

This method creates a system-defined Find dialog box.

Parameters:
FindText The initial text
Flags The flags for the dialog. This parameter can be a combination of the following values: FR_DOWN, FR_WHOLEWORD, FR_MATCHCASE, FR_SHOWHELP, FR_NOUPDOWN, FR_NOMATCHCASE, FR_NOWHOLEWORD, FR_HIDEUPDOWN, FR_HIDEMATCHCASE, FR_HIDEWHOLEWORD
Return values:
pResult The FindReplaceDialog object.

CreateFontDialog ( [out, retval] IDispatch **  pResult  ) 

This method creates a standard font dialog box that enables the user to select a font.

Return values:
pResult The FontDialog object.
Since:
1.1.5.

CreateForm ( [in] LONG  Left,
[in] LONG  Top,
[in] LONG  Width,
[in] LONG  Height,
[in, defaultvalue(WS_DEFAULT)] LONG  Style,
[out, retval] IDispatch **  pControl 
)

This method creates an child form.

Parameters:
Left Specifies the initial horizontal position of the child form
Top Specifies the initial vertical position of the child form
Width Specifies the width of the child form
Height Specifies the height of the child form
Style Specifies the style of the window. This parameter can be a combination of the following values: WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, WS_MAXIMIZEBOX, WS_SIZEBOX, WS_THICKFRAME, WS_SIZEGRIP, WS_SIZEBOX, WS_CONTROLBOX, WS_SYSMENU.
Return values:
pControl Form object.
See also CreateForm.

CreateOpenDialog ( [out, retval] IDispatch **  pResult  ) 

This method creates a standard file open dialog box that enables the user specify the drive, directory, and the name of a file or the names of set of files to open.

Return values:
pResult The FileOpenSaveDialog object.

CreateReplaceDialog ( [in, defaultvalue("")] BSTR  FindText,
[in, defaultvalue("")] BSTR  ReplaceText,
[in, defaultvalue(FR_DOWN)] ULONG  Flags,
[out, retval] IDispatch **  pResult 
)

This method creates a system-defined Find & Replace dialog box that lets the user specify a string to search for and a replacement string.

Parameters:
FindText The initial text
ReplaceText The initial replacement string
Flags The flags for the dialog. This parameter can be a combination of the following values: FR_DOWN, FR_WHOLEWORD, FR_MATCHCASE, FR_SHOWHELP, FR_NOUPDOWN, FR_NOMATCHCASE, FR_NOWHOLEWORD, FR_HIDEUPDOWN, FR_HIDEMATCHCASE, FR_HIDEWHOLEWORD
Return values:
pResult The FindReplaceDialog object.

CreateSaveDialog ( [out, retval] IDispatch **  pResult  ) 

This method creates a standard file save dialog box that enables the user specify the drive, directory, and the name of a file or the names of set of files to save.

Return values:
pResult The FileOpenSaveDialog object.

CreateSelectFolderDialog ( [out, retval] IDispatch **  pResult  ) 

This method creates a standard Folder selection dialog box that enables the user specify the folder.

Return values:
pResult The SelectFolderDialog object.

FontDialog ( [in] IDispatch *  StartValue,
[in, defaultvalue(CF_DEFAULT)] ULONG  Flags,
[out, retval] IDispatch **  pResult 
)

This method creates, display, and operates a standard font dialog box that enables the user to select a font.

Parameters:
StartValue The start font for the dialog
Flags The Flags for the dialog. This parameter can be a combination of the following values: CF_SCREENFONTS, CF_PRINTERFONTS, CF_BOTH, CF_SHOWHELP, CF_EFFECTS, CF_APPLY, CF_ANSIONLY, CF_SCRIPTSONLY, CF_NOVECTORFONTS, CF_NOOEMFONTS, CF_FIXEDPITCHONLY, CF_WYSIWYG, CF_FORCEFONTEXIST, CF_SCALABLEONLY, CF_TTONLY, CF_NOFACESEL, CF_NOSTYLESEL, CF_NOSIZESEL, CF_NOVERTFONTS
Return values:
pResult The user's selected font

Maximize ( void   ) 

This method maximizes the form.

MessageBox ( [in] BSTR  Text,
[in, defaultvalue("")] BSTR  Caption,
[in, defaultvalue(0)] LONG  Flags,
[out, retval] LONG *  pResult 
)

This function creates, displays, and operates a standard message box dialog.

Parameters:
Text The text of the message box dialog
Caption The caption of the message box dialog
Flags The Flags for the dialog. This parameter can be a combination of the following values: MB_ABORTRETRYIGNORE, MB_HELP, MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL, MB_CANCELTRYCONTINUE, MB_ICONEXCLAMATION, MB_ICONWARNING, MB_ICONINFORMATION, MB_ICONASTERISK, MB_ICONQUESTION, MB_ICONSTOP, MB_ICONERROR, MB_ICONHAND, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_DEFBUTTON4 (See also MessageBox in the Microsoft Platform SDK).
Return values:
pResult This parameter can be a one of the following values: IDABORT, IDCANCEL, IDCONTINUE, IDIGNORE, IDNO, IDOK, IDRETRY, IDTRYAGAIN, IDYES.

Minimize ( void   ) 

This method minimizes the form.

OpenDialog ( [in] BSTR  DefaultExt,
[in] BSTR  Filter,
[in, defaultvalue("")] BSTR  StartFile,
[in, defaultvalue(OFN_OPENDEFAULT)] ULONG  Flags,
[out, retval] BSTR *  pFileName 
)

This method creates, display, and operates an standard file open dialog box that enables the user specify the drive, directory, and the name of a file or the names of set of files to open.

Parameters:
DefaultExt The default extension. Method appends this extension to the file name if the user fails to enter an file extension.
Filter The string containing pairs of filter strings, each filter string must be terminated by “|”. The first string in each pair is a display text that describes the filter, and the second string specifies the filter patterns (separated by “;”), for example “Text Files |*.txt;*.doc|All Files|*.*”. Do not include spaces in the patterns string.
StartFile The initial selected file
Flags The Flags for the dialog. This parameter can be a combination of the following values: OFN_READONLY, OFN_OVERWRITEPROMPT, OFN_HIDEREADONLY, OFN_NOCHANGEDIR, OFN_SHOWHELP, OFN_NOVALIDATE, OFN_ALLOWMULTISELECT, OFN_PATHMUSTEXIST, OFN_FILEMUSTEXIST, OFN_CREATEPROMPT, OFN_SHAREAWARE, OFN_NOREADONLYRETURN, OFN_NOTESTFILECREATE, OFN_NONETWORKBUTTON, OFN_NOLONGNAMES, OFN_NODEREFERENCELINKS, OFN_LONGNAMES, OFN_DONTADDTORECENT, OFN_FORCESHOWHIDDEN
Return values:
pFileName The user's selected file
Example (JScript):

o = new ActiveXObject("Scripting.WindowSystemObject")

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 500
f.ClientHeight = 300
f.CenterControl()
f.Text = "Text Editor"

edit = f.CreateEdit(0,0,0,0)
edit.Align = o.Translate("AL_CLIENT")
edit.HideSelection = false
edit.MultiLine = true
edit.ScrollBars = o.Translate("SS_BOTH")

fileMenu = f.Menu.Add("File")
fileMenu.Add("Open","CTRL+O").OnExecute = FileOpen

fileMenu.NewLine()
fileMenu.Add("Exit","ESC").OnExecute = CloseFormHandler

function FileOpen(sender)
{
        var fileName = f.OpenDialog("","Text Files (*.txt)|*.txt")
        if (fileName != "")
        {
                var fs = new ActiveXObject("Scripting.FileSystemObject")
                var file = fs.OpenTextFile(fileName,1,false)
                edit.Clear()
                edit.Text = file.ReadAll()
        }
}

f.Show()

o.Run()

function CloseFormHandler(sender)
{
        sender.Form.Close()
}



PageSetupDialog ( [in, defaultvalue(PSD_DEFAULT)] ULONG  Flags,
[out, retval] IDispatch **  pResult 
)

This method creates, display, and operates an standard Page setup dialog box.

Parameters:
Flags The flags for the dialog. This parameter can be a combination of the following values: PSD_INTHOUSANDTHSOFINCHES, PSD_INHUNDREDTHSOFMILLIMETERS, PSD_DISABLEMARGINS, PSD_DISABLEPRINTER, PSD_NOWARNING, PSD_DISABLEORIENTATION, PSD_DISABLEPAPER, PSD_SHOWHELP, PSD_NONETWORKBUTTON
Return values:
pResult The PageSetupDialog object, if the user uses OK button, in other case NULL.

PrintDialog ( [in, defaultvalue(PD_DEFAULT)] ULONG  Flags,
[in, defaultvalue(0)] USHORT  MinPage,
[in, defaultvalue(0)] USHORT  MaxPage,
[out, retval] IDispatch **  pResult 
)

This method creates, display, and operates an standard Print dialog box that enables the user specify the printer parameters.

Parameters:
Flags The flags for the dialog. This parameter can be a combination of the following values: PD_ALLPAGES, PD_SELECTION, PD_PAGENUMS, PD_NOSELECTION, PD_NOPAGENUMS, PD_COLLATE, PD_PRINTTOFILE, PD_NOWARNING, PD_SHOWHELP, PD_USEDEVMODECOPIES, PD_USEDEVMODECOPIESANDCOLLATE, PD_DISABLEPRINTTOFILE, PD_HIDEPRINTTOFILE, PD_NONETWORKBUTTON.
MinPage The minumum page number that the user can specify
MaxPage The maximum page number that the user can specify
Return values:
pResult The PrintDialog object, if the user uses OK button, in other case NULL.

PrinterSetupDialog ( [in, defaultvalue(PD_DEFAULT)] ULONG  Flags,
[out, retval] IDispatch **  pResult 
)

This method creates, display, and operates an standard Print setup dialog box that enables the user specify the printer parameters.

Parameters:
Flags See Flags in the PrintDialog method
Return values:
pResult The PrintDialogBase object, if the user uses OK button, in other case NULL.

Restore ( void   ) 

This method activates and displays the form.

If the form is minimized or maximized, the form restores its original size and position.

SaveDialog ( [in] BSTR  DefaultExt,
[in] BSTR  Filter,
[in, defaultvalue("")] BSTR  StartFile,
[in, defaultvalue(OFN_SAVEDEFAULT)] ULONG  Flags,
[out, retval] BSTR *  pFileName 
)

This method creates, display, and operates an standard file save dialog box that enables the user specify the drive, directory, and the name of a file or the names of set of files to save.

Parameters:
DefaultExt The default extension. Method appends this extension to the file name if the user fails to enter an file extension.
Filter The string containing pairs of filter strings, each filter string must be terminated by “|”. The first string in each pair is a display text that describes the filter, and the second string specifies the filter patterns (separated by “;”), for example “Text Files |*.txt;*.doc|All Files|*.*”. Do not include spaces in the patterns string.
StartFile The initial selected file
Flags The Flags for the dialog. This parameter can be a combination of the following values: OFN_READONLY, OFN_OVERWRITEPROMPT, OFN_HIDEREADONLY, OFN_NOCHANGEDIR, OFN_SHOWHELP, OFN_NOVALIDATE, OFN_ALLOWMULTISELECT, OFN_PATHMUSTEXIST, OFN_FILEMUSTEXIST, OFN_CREATEPROMPT, OFN_SHAREAWARE, OFN_NOREADONLYRETURN, OFN_NOTESTFILECREATE, OFN_NONETWORKBUTTON, OFN_NOLONGNAMES, OFN_NODEREFERENCELINKS, OFN_LONGNAMES, OFN_DONTADDTORECENT, OFN_FORCESHOWHIDDEN
Return values:
pFileName The user's selected file

SelectFolderDialog ( [in] BSTR  Title,
[in, defaultvalue(BIF_DEFAULT)] ULONG  Flags,
[out, retval] BSTR *  pFolder 
)

This method creates, display, and operates an standard Folder selection dialog box that enables the user specify the folder.

Parameters:
Title The title of the dialog
Flags The flags for the dialog. This parameter can be a combination of the following values: BIF_RETURNONLYFSDIRS, BIF_DONTGOBELOWDOMAIN, BIF_EDITBOX, BIF_NEWDIALOGSTYLE, BIF_USENEWUI, BIF_BROWSEINCLUDEURLS BIF_NONEWFOLDERBUTTON, BIF_BROWSEFORCOMPUTER, BIF_BROWSEFORPRINTER, BIF_BROWSEINCLUDEFILES
Return values:
pFolder The user's selected folder.

ShowModal ( void   ) 

This method shows the form as a modal form.

ShowModal does not return until the form closes.


Property Documentation

IDispatch* RW AcceptButton

Gets or sets the Accept button.

When user uses enter key, the OnClick event of the Accept button occurs.

See also:
Button::Default.

VARIANT_BOOL RW Active

"TRUE" if the form is active.

See also:
WindowSystemObject::ActiveForm.

Form::OnActivate.

See also in MSDN:

IDispatch* RW ActiveControl

Gets or sets the control that has focus on the form.

IDispatch* RW CancelButton

Gets or sets the Cancel button.

When user uses ESC key, the OnClick event of the Cancel button occurs.

See also:
Button::Cancel.

VARIANT_BOOL RW CanClose

The CanClose property is a Boolean value that indicates that the form can be closed.

You can use this property when the OnCloseQuery event occur.

Default value "FALSE".

VARIANT_BOOL RW Caption

The SizeGrip property is a Boolean value that indicates that the form has a title bar.

VARIANT_BOOL RW ControlBox

The ControlBox property is a Boolean value that indicates that the form has a window menu and buttons on its title bar.

VARIANT_BOOL RW Foreground

"TRUE" if the form is the foreground window.

The foreground window is the window with which the user is currently working.

See also:
WindowSystemObject::ForegroundForm.

Form::OnActivate.

See also in MSDN:

IDispatch* RW HelpButton

Gets or sets the Help button.

When user uses F1 key, the OnClick event of the Help button occurs.

VARIANT W Icon

Sets the file name for the Icon of the form.

The file can be an executable file, DLL, or icon file.

An zero-based icon index can be specified at the end of the FileName, for example: "Shell32.dll,16". If this index is a negative number the icon whose resource identifier is equal to the absolute value of the index will be loaded. For example, use -3 to load the icon whose resource identifier is 3.

FileName can also be an object loaded by WindowSystemObject::LoadSysIcon or WindowSystemObject::LoadIcon.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 500
f.ClientHeight = 300
f.CenterControl()

f.Icon = "Shell32.dll,-16"

left = 10
for (i = 1; i<10; i++)
{
	image = f.DrawImage(left,10,0,0,o.LoadIcon("Shell32.dll,-"+i))
	left += image.Width
	left += 10
}

f.Show()

o.Run()

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 500
f.ClientHeight = 300
f.CenterControl()

f.Icon = o.LoadSysIcon(o.Translate("OIC_INFORMATION"))

icon = o.LoadSysIcon(o.Translate("OIC_INFORMATION"))

f.DrawImage(10,10,0,0,icon)

f.Show()

o.Run()

VARIANT_BOOL RW KeyPreview

This property controls when the keyboard event OnKeyUp, OnKeyDown occurs on the form.

If KeyPreview value is TRUE, this keyboard events occur on the form when they occur on the child control that has focus. If KeyPreview value is FALSE>, this keyboard events occur only on the control that has focus.

VARIANT_BOOL RW MaximizeBox

The MaximizeBox property is a Boolean value that indicates that the form has a maximize button.

IDispatch* RW Menu

Gets or sets the menu of the form.

The Action object represents the menu.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.Text = "WSO"
f.ClientWidth = 200
f.ClientHeight = 100
f.CenterControl()

FileMenu = f.Menu.Add("File")

with (FileMenu.Add("Open","CTRL+O"))
{
        OnExecute = OpenFile
}

FileMenu.Add("-")

with (FileMenu.Add("Exit","ESC"))
{
        OnExecute = CloseForm
}

f.Show()

o.Run()


function CloseForm(Sender)
{
        f.Close()
}

function OpenFile(Sender)
{
        //Some code...
}

Result:

Form_Menu.jpg

VARIANT_BOOL RW MinimizeBox

The MinimizeBox property is a Boolean value that indicates that the form has a minimize button.

VARIANT W OnActivate

Sets the event handler for the OnActivate event.

Since:
1.1.14.

VARIANT W OnActiveControlChange

Sets the event handler for the OnActiveControlChange event.

This event occurs when the active control changes.

VARIANT W OnClose

Sets the event handler for the OnClose event.

This event occurs when the form closes.

VARIANT W OnCloseQuery

Sets the event handler for the OnCloseQuery event.

This event occurs when the user tries to close the form.

VARIANT W OnCopyData

Sets the event handler for the OnCopyData event.

Since:
1.1.9.

VARIANT W OnEnterSizeMove

Sets the event handler for the OnEnterSizeMove event.

Since:
1.1.16.

VARIANT W OnExitSizeMove

Sets the event handler for the OnExitSizeMove event.

Since:
1.1.16.

VARIANT W OnHint

Sets the event handler for the OnHint event.

VARIANT W OnHitTest

Sets the event handler for the OnHitTest event.

VARIANT W OnMaximize

Sets the event handler for the OnMaximize event.

Since:
1.1.8.

VARIANT W OnMinimize

Sets the event handler for the OnMinimize event.

Since:
1.1.8.

VARIANT W OnRestore

Sets the event handler for the OnRestore event.

Since:
1.1.8.

ULONG W Region

Gets or sets the region.

See also Regions.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")
r = o.Regions

f = o.CreateForm(0,0,0,0)
f.SizeGrip = false
f.Caption = false
f.MaximizeBox = false
f.Text = "Region Demo"
f.ClientWidth = 150
f.ClientHeight = 150
f.CenterControl()

Region = r.CreatePolygonRgn(0,50,100,50,100,0,150,75,100,150,100,100,0,100,o.Translate("WINDING"))

f.Region = Region
f.Brush.Color = 0x000000FF
f.DrawRegion(0,0,Region)

f.Show()

o.Run()


Result:
Region.jpg

VARIANT_BOOL RW SizeGrip

The SizeGrip property is a Boolean value that indicates that the form has a sizing border.

IDispatch* R TaskBar

Gets the TaskBar object for the form.

Since:
1.1.9.

VARIANT_BOOL RW ToolWindow

The SizeGrip property is a Boolean value that indicates that the form is a tool window.

A tool window has a title bar that is smaller than a normal title bar.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.Text = "WSO"
f.ClientWidth = 200
f.ClientHeight = 100
f.CenterControl()
f.ToolWindow = true

f.Show()

o.Run()

Result:
ToolWindow.jpg

VARIANT_BOOL RW TopMost

The TopMost property is a Boolean value that indicates that the form is a topmost form.

The topmost form shows above all non-topmost forms.


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:12:37 2015. (C) Veretennikov A. B. 2004-2015