WindowsFormOptions class
The Win32-frame settings of a WaynesForm — border style, initial window state, startup position, taskbar visibility, and the title-bar buttons. Exposed as WaynesForm.WindowsOptions; a single instance per form, created automatically.
The fields are applied when the form’s window is made, as the form is first shown. Whether the title-bar buttons appear also depends on whether BorderStyle is one of the styles that include them.
The type itself is Private Class — the instance is accessed only through the form’s WindowsOptions property, and a variable typed as WindowsFormOptions cannot be declared from outside the package.
A form’s code sets the fields in its constructor, Sub New; a WaynesForm raises no Load event (see Setting up a form).
Sub New()
With Me.WindowsOptions
.StartUpPosition = tbStartUpCenterScreen
.BorderStyle = tbFixedDialog
.MaximizeButton = False
.ShowInTaskbar = False
End With
End Sub
Warning BETA 1042
The form’s window is made from the values the form designer saved, and never from these fields as code has set them. A field set in code — in Sub New, before the form is shown, or while it is shown — reads back the new value, but the window’s border, buttons, place, state and taskbar button stay as designed, and no error is raised. Set the fields in the form designer.
Properties
BorderStyle
The Win32 frame style — thin / thick border, resizable / fixed, normal / tool-window title bar. A member of BorderStyle. Default: tbFixedSizable.
ControlBox
Whether the form’s title bar shows the system control box (the icon at the far left of the bar, with the Move / Close menu). Boolean. Default: True.
MaximizeButton
Whether the title bar shows a Maximize button. Boolean. Default: True. Shown when BorderStyle is tbFixedSingle, tbFixedSizable or tbFixedDialog; see BorderStyle.
MinimizeButton
Whether the title bar shows a Minimize button. Boolean. Default: True. Shown when BorderStyle is tbFixedSingle, tbFixedSizable or tbFixedDialog; see BorderStyle.
ShowInTaskbar
Whether the form’s window appears in the Windows taskbar. Boolean. Default: True.
StartUpPosition
How the form’s window is positioned when first shown. A member of StartupPosition. Default: tbStartUpWindowsDefault.
WindowState
The window state of the form when first shown — normal, minimized, or maximized. A member of WindowState. Default: tbNormal.
Events
OnChanged
Raised whenever any of the seven fields is assigned. The parent WaynesForm listens for this event and repaints itself.