WaynesForm class
The top-level form class that hosts the package’s custom controls. A WaynesForm is the equivalent of a Form from the VB package, but instead of being a Win32 native window with controls overlaid on top, it is an owner-drawn surface that paints itself and its child controls through the CustomControls framework.
Within the current release of the package every form created with the designer is hard-coded to use WaynesForm as its root class; other base form classes are planned but not yet supported.
A form has a Caption (shown in the Win32 title bar), a BackgroundFill (painted across its entire client area), and a WindowsOptions sub-object that drives the surrounding Win32 frame — border style, window state, taskbar visibility, minimize / maximize buttons, and so on. Showing the form is done by calling Show; closing it by Close.
Private Sub Form_Load()
Me.Caption = "Welcome"
Me.BackgroundFill.ColorPoints.SetSolidColor vbWhite
With Me.WindowsOptions
.StartUpPosition = tbStartUpCenterScreen
.BorderStyle = tbFixedDialog
.MaximizeButton = False
End With
End Sub
BackgroundFill is an ordinary Fill, so the form can carry a gradient backdrop just as easily as a solid colour — this is what the package’s HelloWorld sample form uses to give itself a soft top-to-bottom wash:
Private Sub Form_Load()
Me.BackgroundFill.SetSimplePattern &HE5E5E5, &HF8F8F8, _
Pattern:=tbGradientNorthToSouth
End Sub
Modal display
The current release supports modal display only. Calling Show with vbModeless writes a debug-print message and otherwise does nothing — call Show vbModal to display the form.
Properties
BackgroundFill
The Fill that paints the form’s entire client area. Defaults to a solid light-grey (WAYNESCOLOR_LIGHTGREY — &HD0D0D0).
Caption
The text shown in the Win32 title bar of the form. String.
Syntax: object.Caption [ = string ]
Controls
The CustomControlsCollection of every control hosted on the form. Inherited from the form base. Read-only — iterate or look up by index / name to reach individual controls.
FormDesignerId
A String holding the unique GUID that associates this form instance with its designer-saved metadata. Inherited from the form base. Application code does not normally read or write this — the framework populates it.
Height
The form’s height in pixels. PixelCount. Inherited.
Left
The form’s left position in pixels — honoured only when WindowsOptions.StartUpPosition is tbStartUpManual. PixelCount. Inherited.
Name
The form’s name within the project. String. Inherited.
Top
The form’s top position in pixels — honoured only when WindowsOptions.StartUpPosition is tbStartUpManual. PixelCount. Inherited.
Width
The form’s width in pixels. PixelCount. Inherited.
WindowsOptions
The WindowsFormOptions that drives the Win32 frame — border style, window state, taskbar visibility, minimize / maximize buttons, system menu.
Methods
Close
Closes the form’s underlying window.
Syntax: object.Close
Show
Shows the form. The current release supports modal display only — calling with vbModeless writes a debug message and otherwise does nothing.
Syntax: object.Show [ Modal ]
- Modal
- optional A member of FormShowConstants. Pass vbModal for the supported modal display; vbModeless is currently a no-op.
StartupShow
Shows the form unconditionally — used by the framework to display the project’s startup form. Application code can call it but Show is the normal entry point.
Syntax: object.StartupShow
Events
Click
Raised when the user clicks on the form’s background — i.e. on a region not occupied by a hosted control.
Syntax: object_Click( )