FormExDesktop advanced
Previous  Next

These methods, properties and events extend the capabilities of an extended form beyond that of a normal Basic4PPC form.

Methods

AddControl(ctrl AS Control): Adds a control to a form. "ctrl" is a control ControlRef.

AddForm(form AS Form) : Adds an owned form to this form. "form" is a control ControlRef. Owned forms are minimized and restored with their owners and are always on top of their owner. They are used for things like Toolboxes and Search forms that need to remain above their owner.
            
BringToFront : Brings this form to the font of other forms.

Close : Closes and disposes of this form.

CancelKey : If KeyPreview is True calling this during a KeyPress event prevents a forms' underlying control seeing the key press that it would otherwise receive.

Hide : Hides the form. The same as using the Visible property.

LayoutMdi(layout AS Int ) : Arranges the child forms within an MDI parent form. Arrange icons only affects minimized children. : 0 Cascade : 1 Tile horizontal : 2 Tile vertical : 3 Arrange icons.

MakeMDIchild(child AS Form ) : Makes child an MDI child form of this form. "child" is a form ControlRef.

MainMenuEnd : End constructing a main menu and add it to the form.

MainMenuStart : Start constructing a main menu.

MenuItemAdd(Text AS String, Tag AS String) : Add an menu option to a MenuItem that displays the string Text and has the string Tag as its' Tag property.

MenuItemEnd : End constructing a menu item within a main menu.

MenuItemStart(String Text, String Tag) : Add an MenuItem to a main menu that displays the string Text and has the string Tag as its' Tag property. This item is not itself selectable. Further items added with MenuItemAdd are selectable.

Run : Run this form as the main form of an application. You start an application by either a Form.Show of a Basic4PPC form or a FormEx.Run of one of an extended form.but NOT both.

Form.Show will display Form as the main form and close the application when Form is closed. It is OK to Show other native Basic4PPC (non-extended) forms as well as extended forms in the application. Do NOT Run any extended forms.
            
FormEx.Run will display the extended form as the main form and close the application when it is closed. It is only OK to show native Basic4PPC (non-extended) forms in the application IF it is ensured that they are ALL closed before the extended form is closed otherwise the application will be left hanging. If this happens in the IDE debugging mode Dbasic will not exit debugging mode and will have to be closed, perhaps losing work. If it happens in a compiled exe then XP or Vista will complain. Note that you have to explicitly close this form to stop the IDE debugger, stopping debugging in the IDE will not close an application started by Run. Show all other forms, do NOT Run them. Only one form needs to be Run and that becomes the main form of the application.

ShowModal : Show this form modally.

Properties

About : String [I] : Gets "About" information and copyright notice.

ActiveMdiChild : String [I] : Gets the name of the Active MDI child form.

BorderStyle : Int [I/O] :  Changes the border style of the form. : 0 None : 1 FixedSingle : 2 Fixed3D : 3 FixedDialog : 4 Sizable : 5 FixedToolWindow : 6 SizableToolWindow.

ClientAreaHeight : Int [I] : Gets the height of the client area.

ClientAreaWidth : Int [I]  : Gets the width of the client area.

Cursor : String [I/O] : Gets or sets the cursor displayed for this form. It is case-insensitive and can be one of :  AppStarting, Arrow, Cross, Default, Hand, Help, HSplit, IBeam, No, NoMove2D, NoMoveHoriz, NoMoveVert, PanEast, PanNE, PanNorth, PanNW, PanSE, PanSouth, PanSW, PanWest, SizeAll, SizeNESW, SizeNS, SizeNWSE, SizeWE, UpArrow, VSplit, WaitCursor.


BackColor : Color [I/O] : Sets or gets the background color of the form - same as Color.

ForeColor  : Color [I/O] : Sets or gets the foreground color of the form.

ControlRef : Form [I] : Gets a reference to the underlying Form control.

DLLVersion : double [I] : Gets the version number of this library.

Handle : IntPtr [I] : Gets the window handle (hWnd) of the form.

HasControlBox : Boolean [I/O] : Determines if a form has a visible control box at the top right.

HasMaximizeBox : Boolean [I/O] : Determines if a form has a visible Maximize box at the top right.

HasMinimizeBox : Boolean [I/O] : Determines if a form has a visible Maximize box at the top right.

Icon: String[O] : Sets the icon of the form to that of the path and filename specified by the string. e.g. FormEx1.Icon = AppPath & "\anicon.ico"


IsMDIchild : Boolean [I] : Gets whether a form is an MDI child or not.

IsMDIparent : Boolean [I/O] :  Gets or sets whether a form is an MDI parent (container) or not.

KeyPreview : Boolean [I/O] :  Gets or sets whether the form can preview keystroke to its' controls.

Left : Int [I/O] : Gets or sets the horizontal location of the form on the screen.

MaximumHeight : Int [I/O] : Gets or sets the maximum height of the form.

MaximumWidth : Int [I/O] : Gets or sets the maximum width of the form.

MinimumHeight : Int [I/O] : Gets or sets the minimum height of the form.

MinimumWidth : Int [I/O] : Gets or sets the minimum width of the form.

MenuText : String [I] : Gets the Text property of the last MenuItem clicked.

MenuTag : String [I] : Gets the Tag property of the last MenuItem clicked.

Modal : Boolean [I] : Get if the form is displayed modally.

MouseX : Int [I] : Gets the horizontal position in pixels of the mouse cursor within the form window.

MouseY : Int [I] : Gets the vertical position of the mouse cursor in pixels within the form window.

MouseW : Int [I] : Gets how many detents the mouse wheel has rotated since the last MouseWheel event. Can be positive or negative and for some reason known only to Microsoft increments 120 for each detent.

MouseButton : Int [I] : Gets the state of the mouse buttons on the last Mouse event that set them : 0 None : 1 Left : 2 Right : 3 Middle.

Opacity : double [I/O] : Gets or sets the opacity of the form. Values are 0.0 (transparent) to 1.0 (fully opaque). May not work on some systems depending on the video card driver which must support the Layered Windows API that was introduced with Windows 2000. Most do.

ShowInTaskbar : Boolean [I/O] : Gets or sets whether the form is shown in the taskbar and Task Manager.

StartPosition  : Int [I/O] : Gets or sets the starting position of the form. 1 is the default. : 0 manual : 1 center screen : 2 windows default position : 3 windows default bounds : 4 center parent.

Tag : String [I/O] : gets or sets a Tag property for the form. Free use by the programmer for any purpose.

Top : Int [I/O] : Gets or set the vertical location of the form on the screen.

TopMost : Boolean [I/O] : Gets or sets whether the form is always shown on top of the other forms.

TransparencyKey : Color [I/O] : Gets or sets the color that is regarded as transparent by the form and its' controls.

UseWaitCursor : Boolean [I/O] : Gets or sets whether the wait cursor is displayed for this form.

Visible : Boolean [I/O] : Gets or sets whether the form is visible. Same effect as the Hide and Show methods.

WindowState : Int  [I/O] : Gets or sets the window state of the form. : 0 normal : 1 minimized : 2 maximized.


Events

Click - Occurs when a form is clicked.

GotFocus - Occurs when a form is activated.

MdiChildGotFocus - Occurs when the activation of an MDI child form changes to another.

LostFocus : Occurs when a form is deactivated.

MenuClick - Occurs when a menu item built with the forms' MenuItemAdd method. is selected. Retrieve the menu item and its' tag with the forms' MenuText and MenuTag properties. Inherited menu events are dealt with as is usual under Basic4PPC.

MouseClick - The MouseButton property only shows the changed button in this event.

MouseDoubleClick - The MouseButton property only shows the changed button in this event.

MouseEnter - The MouseButton property is not changed in this event.

MouseHover - The MouseButton property is not changed in this event.

MouseLeave - The MouseButton property is not changed in this event.

MouseWheel - The MouseButton property  is always 0 in this event.

Paint - Occurs when the form wants to be repainted.

Resize -Occurs repeatedly as the user resizes the form. Also occurs once when the form is maximised, minimised or restored. Use the WindowState property to check the state of the form.

ResizeBegin - Occurs once as the user starts to resize the form.

ResizeEnd - Occurs once when the user ends resizing the form.

SizeChanged - Occurs repeatedly as the user resizes the form.