Form Class

Form Class

This Package | All Packages

Component
  |
  +--Control
    |
    +--Form
public class Form
extends Control

Represents the basic top-level window.

Constructors
Name Description
Form() Creates a new form.
addOwnedForm(Form ownedForm) Adds an owned form to this form.
removeOwnedForm(Form ownedForm) Removes a form from the list of owned forms.

Methods
Name Description
add(Control control) Adds a control to the form.
addOnClosed(EventHandler value) Adds an event handler for the Closed event.
addOnClosing(CancelEventHandler value) Adds an event handler for the Closing event.
addOnInputLangChange( InputLangChangeEventHandler value) Adds an event handler for the InputLangChange event.
addOnInputLangChangeRequest( InputLangChangeRequestEventHandler value) Adds an event handler for the InputLangChangeRequest event.
addOnMDIChildActivate(EventHandler value) Adds an event handler for the MDIChildActivate event.
adjustFormScrollbars( boolean displayScrollbars) Adjust the automatic scroll bars on the form based on current control positions and the current selected control.
createControl() Topic under construction.
createHandle() Creates the handle for the form.
defWndProc(Message m) Calls the default window proc for the form.
dispose() Releases all the system resources associated with the form.
fillInCreateParamsBorderIcons(CreateParams cp) Adjusts the window style of the CreateParams to reflect the border icons.
fillInCreateParamsBorderStyles(CreateParams cp) Adjusts the window style of the CreateParams to reflect the border style.
fillInCreateParamsStartPosition(CreateParams cp) Adjusts the CreateParams to reflect the window bounds and start position.
fillInCreateParamsWindowState(CreateParams cp) Adjusts the Createparams to reflect the window state.
getAcceptButton() Retrieves the current acceptButton.
getActiveControl() Retrieves the current active control.
getActiveMDIChild() Retrieves the current MDIChild window that is active.
getAutoScale() Retrieves the current value of the AutoScale property.
getAutoScaleBaseSize() Retrieves the base size used for autoscaling.
getAutoScroll() Retrieves the current value of the AutoScroll property.
getAutoScrollMargin() Retrieves the current value of the AutoScrollMargin property.
getAutoScrollPosition() Retrieves the current value of the AutoScrollPosition property.
getAxContainer() Topic under construction.
getBorderStyle() Retrieves the current value of the BorderStyle property.
getCancelButton() Retrieves the current CancelButton.
getClientSize() Retrieves the current clientSize of the form.
getControlBox() Retrieves the current value of the ControlBox property.
getCreateParams() Retrieves the CreateParams used to create the window.
getDesktopBounds() Retrieves the bounds of the form in desktop coordinates.
getDesktopLocation() Retrieves the location of the form in desktop coordinates.
getDialogResult() Retrieves the current value of the DialogResult property.
getDisplayRect() Retreives the current display rectangle.
getForm() Retrieves the form that this control is parented to.
getFormState(int flag) Retrieves the bits associated with the requested formstate.
getHelpButton() Retrieves the current value of the HelpButton property.
getHScroll() Retrieves the current value of the HScroll property.
getIcon() Returns the current value of the Icon property.
getIsMDIChild() Returns a boolean indicating whether this form is an MDI child form.
getIsMDIContainer() Returns a boolean indicating whether this form is an MDI container.
getIsMenuBarContainer() Returns a boolean indicating whether this form is a Menu Bar Container.
getKeyPreview() Returns the current value of the KeyPreview property.
getMaxButton() Returns the current value of the MaxButton property.
getMaximizedBounds() Returns the maximized bounds of the form.
getMaxTrackSize() Returns the maximum size the form can be resized to.
getMDIClient() Returns the control that is the MDI Client region.
getMDIParent() Returns the current MDI parent of this form.
getMenu() Returns the current Menu for this form.
getMergedMenu() Returns the merged menu for the form.
getMinButton() Returns the current value of the MinButton property.
getMinTrackSize() Returns the minimum size the form can be resized to.
getModal() Returns the modal status of the form.
getOwnedForms() Returns an array of forms that are owned by this form.
getOwner() Returns the owner of this form.
getPalette() Returns the palette currently being used by the form.
getPaletteMode() Returns the current value of the PaletteMode property.
getPaletteSource() Returns the current value of the PaletteSource property.
getParentForm() Returns the form that is the visual parent of this form.
getShowInTaskbar() Returns the current value of the ShowInTaskbar property.
getStartPosition() Returns the current value of the StartPosition property.
getWindowState() Returns the current value of the WindowState property.
hasDefaultAutoScrollPosition() Topic under construction.
hasFormState(int flag) Returns whether any of the bits in the mask are on.
invalidateFrame() Forces a WM_WINDOWPOSCHANGED message to be sent that tells the form that the frame has changed.
invalidateMergedMenu() Invalidates the merged menu, forcing the menu to be re-created if needed again.
layoutCore(Control dockLast) Forces the layout of any docked or anchored child controls.
layoutMDI(int value) Arranges the MDI child forms according to value, which should be a member of the MDILayout enum.
menuChanged(int change, Menu menu) Topic under construction.
menuChanged(int change, Menu menu, Form form) Topic under construction.
onClosed(Event e) The Closed event is fired when the form is closed.
onClosing(CancelEvent e) The Closing event is fired when the form is closed.
onInputLangChange(InputLangChangeEvent e) The InputLangChange event is fired after the input language has changed for this form.
onInputLangChangeRequest( InputLangChangeRequestEvent e) The InputLangChangeRequest event is fired when the user attempts to change the input language for this form.
onMDIChildActivate(Form form) This function handles the activation of a MDI child form.
onMDIChildActivate(Event e) The MDIChildActivate event is fired when a MDI Child window is activated.
onNewPalette(boolean fForceBackground) Topic under construction.
onResize(Event event) The Resize event is fired when the form is resized.
pointToScreen(Point p) Topic under construction.
processCmdKey(MSG msg, int keyData) Topic under construction.
processDialogChar(char charCode) Topic under construction.
processDialogKey(int keyData) Topic under construction.
processKeyPreview(Message m) Topic under construction.
processMnemonic(char charCode) Topic under construction.
propertyChanged(int property) Topic under construction.
rectToClient(Rectangle r) Topic under construction.
rectToScreen(Rectangle r) Topic under construction.
removeOnClosed(EventHandler value) Removes an event handler for the Closed event.
removeOnClosing(CancelEventHandler value) Removes an event handler for the Closing event.
removeOnInputLangChange( InputLangChangeEventHandler value) Removes an event handler for the InputLangChange event.
removeOnInputLangChangeRequest( InputLangChangeRequestEventHandler value) Removes an event handler for the InputLangChangeRequest event.
removeOnMDIChildActivate(EventHandler value) Removes an event handler for the MDIChildActivate event.
resumeUpdateMenuHandles() Decrements updateMenuHandleSuspendCount.
scaleCore(float x, float y) Base function that performs scaling of the form.
select(boolean directed, boolean forward) Selects this form, and optionally selects the next/previous control.
setAcceptButton(IButtonControl button) Sets the control that is the AcceptButton.
setActiveControl(Control value) Sets the control that is currently active.
setAutoScale(boolean value) Sets the AutoScale property.
setAutoScaleBaseSize(int value) Sets the AutoScaleBaseSize.
setAutoScroll(boolean value) Sets the AutoScroll property.
setAutoScrollMargin(Point value) Sets the margins used during AutoScrolling.
setAutoScrollPosition(Point value) Sets the default position of the AutoScroll region.
setBorderStyle(int borderStyle) Sets the border style for the form.
setCancelButton(IButtonControl button) Sets the cancelButton for the Form.
setClientSize(Point clientSize) Sets the clientSize of the form.
setControlBox(boolean controlBox) Sets the value for the ControlBox property.
setDesktopBounds(Rectangle bounds) Sets the bounds of the Form in desktop coordinates.
setDesktopBounds(int x, int y, int width, int height) Sets the bounds of the form in desktop coordinates.
setDesktopLocation(Point loc) Sets the location of the form in desktop coordinates.
setDesktopLocation(int x, int y) Sets the location of the form in desktop coordinates.
setDialogResult(int value) Sets the value that will be returned from the form when it is displayed as a modal dialog.
setFormState(int flag, boolean value) This will turn all the bits on or off for the specified FORMSTATE_* property.
setFormState(int flag, int value) This will set the value of the specified FORMSTATE_* property.
setHelpButton(boolean helpButton) Sets the HelpButton property.
setIcon(Icon icon) Sets the icon to be displayed in the caption bar of the form.
setIsMDIContainer(boolean value) Sets the value for the IsMDIContainer property.
setKeyPreview(boolean keyPreview) Sets the KeyPreview property.
setMaxButton(boolean maxButton) Sets the value for the MaxButton property.
setMDIParent(Form form) Sets the MDIParent for this form.
setMenu(MainMenu value) Sets the main menu for this form.
setMinButton(boolean minButton) Sets the value for the MinButton property.
setNewControls(Control[] ctls) Topic under construction.
setOwner(Form owner) Sets the owner for this form.
setPaletteMode(int paletteMode) Sets the PaletteMode for the Form.
setPaletteSource(Control paletteSource) Sets the source for the form's palette if the Form PaletteMode is FormPaletteMode.USE_CONTROL.
setParentHandle(int value) Sets the HWND parent of this form.
setShowInTaskbar(boolean showInTaskbar) Sets the ShowInTaskbar property.
setStartPosition(int startPosition) Sets the StartPosition for the form.
setVisible(boolean value) Sets the visibility of the form.
setWindowState(int windowState) Sets the WindowState of the form.
showDialog() Shows this form as a modal dialog with no owner.
showDialog(Form owner) Shows this form as a modal dialog with the specified owner.
suspendUpdateMenuHandles() Increments updateMenuHandleSuspendCount.
updateMenuHandles(MainMenu menu, boolean forceRedraw) Topic under construction.
updateStyles() Topic under construction.
wndProc(Message m) Base wndProc encapsulation.

Constructors

Form.Form

Syntax
public Form();
Description

Creates a new form.

Form.addOwnedForm

Syntax
public void addOwnedForm( Form ownedForm );
Parameters
ownedForm
Form to make owned by this form.
Description

Adds an owned form to this form. Owned forms are other top-level forms that are children of this form.

Form.removeOwnedForm

Syntax
public void removeOwnedForm( Form ownedForm );
Parameters
ownedForm
Form to remove.
Description

Removes a form from the list of owned forms. Also sets the owner of the removed form to null.

See Also
addOwnedForm

Methods

Form.add

Syntax
public void add( Control control );
Parameters
control
Control to add to the form.
Description

Adds a control to the form. This visually parents the specified control to the form.

Overrides

add(Control) in Control.

See Also
remove

Form.addOnClosed

Syntax
public void addOnClosed( EventHandler value );
Parameters
value
Delegate to call when the event is fired.
Description

Adds an event handler for the Closed event. The Closed event is fired when the form is closed.

See Also
wfc.core.EventHandler, removeOnClosed

Form.addOnClosing

Syntax
public void addOnClosing( CancelEventHandler value );
Parameters
value
Delegate to call when the event is fired.
Description

Adds an event handler for the Closing event. The Closing event is fired when the form is closed.

See Also
wfc.core.CancelEventHandler, removeOnClosing

Form.addOnInputLangChange

Syntax
public void addOnInputLangChange( InputLangChangeEventHandler value );
Parameters
value
Delegate to call when the event is fired.
Description

Adds an event handler for the InputLangChange event. The InputLangChange event is fired after the input language has changed for this form.

See Also
wfc.ui.InputLangChangeEventHandler, removeOnInputLangChange

Form.addOnInputLangChangeRequest

Syntax
public void addOnInputLangChangeRequest( InputLangChangeRequestEventHandler value );
Parameters
value
Delegate to call when the event is fired.
Description

Adds an event handler for the InputLangChangeRequest event. The InputLangChangeRequest event is fired when the user attempts to change the input language for this form. If the event is canceled, the input language will not change.

See Also
wfc.ui.InputLangChangeRequestEventHandler, removeOnInputLangChangeRequest

Form.addOnMDIChildActivate

Syntax
public void addOnMDIChildActivate( EventHandler value );
Parameters
value
Delegate to call when the event is fired.
Description

Adds an event handler for the MDIChildActivate event. The MDIChildActivate occurs when a MDIChild window is activated.

See Also
wfc.core.EventHandler, removeOnMDIChildActivate

Form.adjustFormScrollbars

Syntax
protected final void adjustFormScrollbars( boolean displayScrollbars );
Parameters
displayScrollbars
Determines if the scroll bars should be displayed.
Description

Adjust the automatic scroll bars on the form based on current control positions and the current selected control.

See Also
getAutoScroll

Form.createControl

Syntax
public void createControl();
Description

Topic under construction.

Overrides

createControl() in Control.

Form.createHandle

Syntax
protected void createHandle();
Description

Creates the handle for the form. If a subclass overrides this function, it must call the super implementation.

Overrides

createHandle() in Control.

See Also
Control.createHandle

Form.defWndProc

Syntax
protected void defWndProc( Message m );
Description

Calls the default window proc for the form. If a subclass overrides this function, it must call the super implementation.

Overrides

defWndProc(Message) in Control.

See Also
Control.defWndProc

Form.dispose

Syntax
public void dispose();
Description

Releases all the system resources associated with the form. If a subclass overrides this function, it must call the super implementation.

Overrides

dispose() in Control.

Form.fillInCreateParamsBorderIcons

Syntax
protected void fillInCreateParamsBorderIcons( CreateParams cp );
Parameters
cp
CreateParams to modify.
Description

Adjusts the window style of the CreateParams to reflect the border icons. If a subclass overrides this function, it must call the super implementation.

Form.fillInCreateParamsBorderStyles

Syntax
protected void fillInCreateParamsBorderStyles( CreateParams cp );
Parameters
cp
CreateParams to modify.
Description

Adjusts the window style of the CreateParams to reflect the border style. If a subclass overrides this function, it must call the super implementation.

Form.fillInCreateParamsStartPosition

Syntax
protected void fillInCreateParamsStartPosition( CreateParams cp );
Parameters
cp
CreateParams to modify.
Description

Adjusts the CreateParams to reflect the window bounds and start position. If a subclass overrides this function, it must call the super implementation.

Form.fillInCreateParamsWindowState

Syntax
protected void fillInCreateParamsWindowState( CreateParams cp );
Parameters
cp
CreateParams to modify.
Description

Adjusts the Createparams to reflect the window state. If a subclass overrides this function, it must call the super implementation.

Form.getAcceptButton

Syntax
public IButtonControl getAcceptButton();
Return Value

Returns control that current is the acceptButton.

Description

Retrieves the current acceptButton.

See Also
setAcceptButton

Form.getActiveControl

Syntax
public Control getActiveControl();
Return Value

Returns current active control.

Description

Retrieves the current active control.

See Also
setActiveControl

Form.getActiveMDIChild

Syntax
public Form getActiveMDIChild();
Return Value

Returns active MDIChild window.

Description

Retrieves the current MDIChild window that is active. Returns null if there are no MDIChild windows.

Form.getAutoScale

Syntax
public boolean getAutoScale();
Return Value

Returns current value of the AutoScale property.

Description

Retrieves the current value of the AutoScale property. When AutoScale is set to true, the form will adjust the size of the form to fit the height of the font that is used on the form. All child controls will also be scaled. This allows the form to resize to fit systems with Large Fonts and international systems.

See Also
setAutoScale

Form.getAutoScaleBaseSize

Syntax
public final int getAutoScaleBaseSize();
Return Value

Returns base autoScaling size.

Description

Retrieves the base size used for autoscaling. The AutoScaleBaseSize is used internally to determine how much to scale the form when AutoScaling is used.

See Also
getAutoScaleBaseSize, setAutoScale

Form.getAutoScroll

Syntax
public boolean getAutoScroll();
Return Value

Returns current value of the AutoScroll property.

Description

Retrieves the current value of the AutoScroll property. When AutoScroll is set to true, the form will allow the user to scroll the contents of the form if any child controls are placed outside the bounds of the form. This allows the form to have a virtual size that is larger than the current form bounds.

See Also
setAutoScroll

Form.getAutoScrollMargin

Syntax
public Point getAutoScrollMargin();
Return Value

Returns current value of the AutoScrollMargin property.

Description

Retrieves the current value of the AutoScrollMargin property. The margins define the width and height of the border around each control. This border is used to determine when scroll bars are needed on the form and where to scroll to when a control is selected.

See Also
setAutoScrollMargin

Form.getAutoScrollPosition

Syntax
public final Point getAutoScrollPosition();
Return Value

Returns current value of the AutoScrollPosition property.

Description

Retrieves the current value of the AutoScrollPosition property. The AutoScrollPosition property is used internally to adjust the position of controls that are placed on the form through the form designer.

See Also
setAutoScrollPosition

Form.getAxContainer

Syntax
public AxHost.Container getAxContainer();
Description

Topic under construction.

Overrides

getAxContainer() in Control.

Form.getBorderStyle

Syntax
public int getBorderStyle();
Return Value

Returns current value of the BorderStyle property.

Description

Retrieves the current value of the BorderStyle property. The border style of the form determines how the outer edge of the form appears. In addition, certain border styles prevent the form from being sized.

See Also
setBorderStyle

Form.getCancelButton

Syntax
public IButtonControl getCancelButton();
Return Value

Returns current cancelButton.

Description

Retrieves the current CancelButton. The cancel button will be "clicked" when the user presses ESC.

See Also
setCancelButton

Form.getClientSize

Syntax
public Point getClientSize();
Return Value

Returns current clientSize of the form.

Description

Retrieves the current clientSize of the form. The clientSize of a form is the width and height of it's clientRect. The distinction between the clientRect and clientSize is that the clientSize can be set. It also represents the requested size of the clientRect.

Overrides

getClientSize() in Control.

See Also
setClientSize

Form.getControlBox

Syntax
public boolean getControlBox();
Return Value

Returns current value of the ControlBox property.

Description

Retrieves the current value of the ControlBox property. If ControlBox is set to true, the control box will be displayed in the upper- left corner of the caption bar. The control box is where the user can click to access the system menu.

See Also
setControlBox

Form.getCreateParams

Syntax
protected CreateParams getCreateParams();
Return Value

Returns CreateParams used to create the window.

Description

Retrieves the CreateParams used to create the window. If a subclass overrides this function, it must call the super implementation.

Overrides

getCreateParams() in Control.

See Also
Control.getCreateParams

Form.getDesktopBounds

Syntax
public Rectangle getDesktopBounds();
Return Value

Returns bounds of the form in desktop coordinates.

Description

Retrieves the bounds of the form in desktop coordinates.

See Also
setDesktopBounds

Form.getDesktopLocation

Syntax
public Point getDesktopLocation();
Return Value

Returns location of the form in desktop coordinates.

Description

Retrieves the location of the form in desktop coordinates.

See Also
setDesktopLocation

Form.getDialogResult

Syntax
public int getDialogResult();
Return Value

Returns current value of the DialogResult property.

Description

Retrieves the current value of the DialogResult property.

See Also
setDialogResult

Form.getDisplayRect

Syntax
public Rectangle getDisplayRect();
Return Value

Returns current display rectangle.

Description

Retreives the current display rectangle. The display rectangle is the virtual display area that is used to lay out components. The position and dimensions of the form's display rectangle change during autoScroll.

Overrides

getDisplayRect() in Control.

Form.getForm

Syntax
public Form getForm();
Return Value

Returns form that this form is parented to.

Description

Retrieves the form that this control is parented to.

Overrides

getForm() in Control.

Form.getFormState

Syntax
protected final int getFormState( int flag );
Return Value

Returns value of the formState property.

Description

Retrieves the bits associated with the requested formstate.

See Also
setFormState, hasFormState

Form.getHelpButton

Syntax
public boolean getHelpButton();
Return Value

Returns current value of the HelpButton property.

Description

Retrieves the current value of the HelpButton property. If HelpButton is set to true, a small question mark will appear in the caption bar to the left of the minimize, maximize, and close buttons.

See Also
setHelpButton

Form.getHScroll

Syntax
protected final boolean getHScroll();
Return Value

Returns true if the Auto-HorizScrollbar is visible.

Description

Retrieves the current value of the HScroll property.

See Also
setHScroll

Form.getIcon

Syntax
public Icon getIcon();
Return Value

Returns current value of the Icon property.

Description

Returns the current value of the Icon property.

See Also
setIcon

Form.getIsMDIChild

Syntax
public boolean getIsMDIChild();
Return Value

Returns true if this is an MDI child.

Description

Returns a boolean indicating whether this form is an MDI child form.

See Also
setMDIParent

Form.getIsMDIContainer

Syntax
public boolean getIsMDIContainer();
Return Value

Returns true if this form is an MDI container.

Description

Returns a boolean indicating whether this form is an MDI container.

Form.getIsMenuBarContainer

Syntax
public boolean getIsMenuBarContainer();
Return Value

Returns true if this form is a menu bar container

Description

Returns a boolean indicating whether this form is a Menu Bar Container.

Form.getKeyPreview

Syntax
public boolean getKeyPreview();
Return Value

Returns current value of the KeyPreview property.

Description

Returns the current value of the KeyPreview property.

See Also
setKeyPreview

Form.getMaxButton

Syntax
public boolean getMaxButton();
Return Value

Returns current value of the MaxButton property.

Description

Returns the current value of the MaxButton property.

See Also
setMaxButton

Form.getMaximizedBounds

Syntax
protected Rectangle getMaximizedBounds();
Return Value

Returns bounds of the form when it is maximized.

Description

Returns the maximized bounds of the form. Classes that extend form can override this function to provide new bounds for the form when it is maximized. This function is called when the form is being resized.

See Also
getMaxTrackSize, getMinTrackSize, SystemInformation.getPrimaryMonitorMaximizedWindowSize

Form.getMaxTrackSize

Syntax
protected Point getMaxTrackSize();
Return Value

Returns maximum size the form can be sized to.

Description

Returns the maximum size the form can be resized to. Classes that extend form can override this function to provide a new maximum size for the form. This function is called when the form is being resized.

See Also
getMaximizedBounds, getMinTrackSize, SystemInformation.getMaxWindowTrackSize

Form.getMDIClient

Syntax
public Control getMDIClient();
Return Value

Returns MDI Client control.

Description

Returns the control that is the MDI Client region.

Form.getMDIParent

Syntax
public Form getMDIParent();
Return Value

Returns current MDI parent of this form.

Description

Returns the current MDI parent of this form.

See Also
setMDIParent

Form.getMenu

Syntax
public MainMenu getMenu();
Return Value

Returns current Menu for this form.

Description

Returns the current Menu for this form.

See Also
setMenu

Form.getMergedMenu

Syntax
public MainMenu getMergedMenu();
Return Value

Returns merged menu.

Description

Returns the merged menu for the form. This is primarily used when this form is an MDI child that merges its menu with the parent form's menu.

Form.getMinButton

Syntax
public boolean getMinButton();
Return Value

Returns current value of the MinButton property.

Description

Returns the current value of the MinButton property.

See Also
setMinButton

Form.getMinTrackSize

Syntax
protected Point getMinTrackSize();
Return Value

Returns minimum size the form can be sized to.

Description

Returns the minimum size the form can be resized to. Classes that extend form can override this function to provide a new minimum size for the form. This function is called when the form is being resized.

See Also
getMaximizedBounds, getMaxTrackSize, SystemInformation.getMinWindowTrackSize

Form.getModal

Syntax
public boolean getModal();
Return Value

Returns s true if this form is currently modal.

Description

Returns the modal status of the form.

See Also
showDialog

Form.getOwnedForms

Syntax
public Form[] getOwnedForms();
Return Value

Returns s array of forms that are owned by this form.

Description

Returns an array of forms that are owned by this form.

See Also
addOwnedForm, removeOwnedForm

Form.getOwner

Syntax
public Form getOwner();
Return Value

Returns form that currently owns this form.

Description

Returns the owner of this form.

Form.getPalette

Syntax
public Palette getPalette();
Description

Returns the palette currently being used by the form.

Overrides

getPalette() in Control.

See Also
setPaletteMode, setPaletteSource

Form.getPaletteMode

Syntax
public int getPaletteMode();
Return Value

Returns current value of the PaletteMode property.

Description

Returns the current value of the PaletteMode property.

See Also
setPaletteMode

Form.getPaletteSource

Syntax
public Control getPaletteSource();
Return Value

Returns current value of the PaletteSource property.

Description

Returns the current value of the PaletteSource property.

See Also
setPaletteSource

Form.getParentForm

Syntax
public Form getParentForm();
Return Value

Returns current value of the ParentForm property.

Description

Returns the form that is the visual parent of this form.

See Also
setParent

Form.getShowInTaskbar

Syntax
public boolean getShowInTaskbar();
Return Value

Returns current value of the ShowInTaskbar property.

Description

Returns the current value of the ShowInTaskbar property.

See Also
setShowInTaskbar

Form.getStartPosition

Syntax
public int getStartPosition();
Return Value

Returns Current value of teh StartPosition property.

Description

Returns the current value of the StartPosition property.

See Also
setStartPosition

Form.getWindowState

Syntax
public int getWindowState();
Return Value

Returns current value of the WindowState property.

Description

Returns the current value of the WindowState property.

See Also
setWindowState

Form.hasDefaultAutoScrollPosition

Syntax
public boolean hasDefaultAutoScrollPosition();
Description

Topic under construction.

Form.hasFormState

Syntax
protected final boolean hasFormState( int flag );
Return Value

Returns true if any of the bits are on.

Description

Returns whether any of the bits in the mask are on.

See Also
setFormState, getFormState

Form.invalidateFrame

Syntax
protected void invalidateFrame();
Description

Forces a WM_WINDOWPOSCHANGED message to be sent that tells the form that the frame has changed.

Form.invalidateMergedMenu

Syntax
protected void invalidateMergedMenu();
Description

Invalidates the merged menu, forcing the menu to be re-created if needed again.

Form.layoutCore

Syntax
protected void layoutCore( Control dockLast );
Description

Forces the layout of any docked or anchored child controls.

Overrides

layoutCore(Control) in Control.

Form.layoutMDI

Syntax
public void layoutMDI( int value );
Description

Arranges the MDI child forms according to value, which should be a member of the MDILayout enum.

See Also
wfc.ui.MDILayout

Form.menuChanged

Syntax 1
public void menuChanged( int change, Menu menu );
Description

Topic under construction.



Syntax 2
public void menuChanged( int change, Menu menu, Form form );
Description

Topic under construction.

Form.onClosed

Syntax
protected void onClosed( Event e );
Description

The Closed event is fired when the form is closed.

See Also
addOnClosed, removeOnClosed, wfc.core.Event

Form.onClosing

Syntax
protected void onClosing( CancelEvent e );
Description

The Closing event is fired when the form is closed.

See Also
addOnClosing, removeOnClosing, wfc.core.CancelEvent

Form.onInputLangChange

Syntax
protected void onInputLangChange( InputLangChangeEvent e );
Description

The InputLangChange event is fired after the input language has changed for this form.

See Also
addOnInputLangChange, removeOnInputLangChange, wfc.ui.InputLangChangeEvent

Form.onInputLangChangeRequest

Syntax
protected void onInputLangChangeRequest( InputLangChangeRequestEvent e );
Description

The InputLangChangeRequest event is fired when the user attempts to change the input language for this form. If the event is canceled, the input language will not change.

See Also
addOnInputLangChangeRequest, removeOnInputLangChangeRequest, wfc.ui.InputLangChangeRequestEvent

Form.onMDIChildActivate

Syntax 1
protected void onMDIChildActivate( Form form );
Parameters
form
Form that is being activated.
Description

This function handles the activation of a MDI child form. If a subclass overrides this function, it must call super.onMDIChildActivate.



Syntax 2
protected void onMDIChildActivate( Event e );
Description

The MDIChildActivate event is fired when a MDI Child window is activated.

See Also
addOnMDIChildActivate, removeOnMDIChildActivate, Event

Form.onNewPalette

Syntax
protected boolean onNewPalette( boolean fForceBackground );
Description

Topic under construction.

Form.onResize

Syntax
protected void onResize( Event event );
Description

The Resize event is fired when the form is resized.

Overrides

onResize(Event) in Control.

See Also
addOnResize, removeOnResize, Event

Form.pointToScreen

Syntax
public Point pointToScreen( Point p );
Description

Topic under construction.

Overrides

pointToScreen(Point) in Control.

Form.processCmdKey

Syntax
protected boolean processCmdKey( MSG msg, int keyData );
Description

Topic under construction.

Overrides

processCmdKey(MSG,int) in Control.

Form.processDialogChar

Syntax
protected boolean processDialogChar( char charCode );
Description

Topic under construction.

Overrides

processDialogChar(char) in Control.

Form.processDialogKey

Syntax
protected boolean processDialogKey( int keyData );
Description

Topic under construction.

Overrides

processDialogKey(int) in Control.

Form.processKeyPreview

Syntax
protected boolean processKeyPreview( Message m );
Description

Topic under construction.

Form.processMnemonic

Syntax
protected boolean processMnemonic( char charCode );
Description

Topic under construction.

Overrides

processMnemonic(char) in Control.

Form.propertyChanged

Syntax
protected void propertyChanged( int property );
Description

Topic under construction.

Overrides

propertyChanged(int) in Control.

Form.rectToClient

Syntax
public Rectangle rectToClient( Rectangle r );
Description

Topic under construction.

Overrides

rectToClient(Rectangle) in Control.

Form.rectToScreen

Syntax
public Rectangle rectToScreen( Rectangle r );
Description

Topic under construction.

Overrides

rectToScreen(Rectangle) in Control.

Form.removeOnClosed

Syntax
public void removeOnClosed( EventHandler value );
Parameters
value
Delegate to remove from the list of delegates to fire for this event.
Description

Removes an event handler for the Closed event.

See Also
onClose

Form.removeOnClosing

Syntax
public void removeOnClosing( CancelEventHandler value );
Parameters
value
Delegate to remove from the list of delegates to fire for this event.
Description

Removes an event handler for the Closing event.

See Also
onClose

Form.removeOnInputLangChange

Syntax
public void removeOnInputLangChange( InputLangChangeEventHandler value );
Parameters
value
Delegate to remove from the list of delegates to fire for this event.
Description

Removes an event handler for the InputLangChange event.

See Also
onInputLangChange

Form.removeOnInputLangChangeRequest

Syntax
public void removeOnInputLangChangeRequest( InputLangChangeRequestEventHandler value );
Parameters
value
Delegate to remove from the list of delegates to fire for this event.
Description

Removes an event handler for the InputLangChangeRequest event.

See Also
onInputLangChangeRequest

Form.removeOnMDIChildActivate

Syntax
public void removeOnMDIChildActivate( EventHandler value );
Parameters
value
Delegate to remove from the list of delegates to fire for this event.
Description

Removes an event handler for the MDIChildActivate event.

See Also
onMDIChildActivate

Form.resumeUpdateMenuHandles

Syntax
protected void resumeUpdateMenuHandles();
Description

Decrements updateMenuHandleSuspendCount. If updateMenuHandleSuspendCount becomes zero and updateMenuHandlesDeferred is true, updateMenuHandles is called.

See Also
suspendUpdateMenuHandles

Form.scaleCore

Syntax
protected void scaleCore( float x, float y );
Parameters
x
Percentage to scale the form horizontally.
y
Percentage to scale the form vertically.
Description

Base function that performs scaling of the form.

Overrides

scaleCore(float,float) in Control.

See Also
Control.scaleCore

Form.select

Syntax
public void select( boolean directed, boolean forward );
Parameters
directed
If set to true, the active control is changed
forward
Controls the direction in which focus is moved. If set to true, the next control is selected; otherwise, the previous control is selected.
Description

Selects this form, and optionally selects the next/previous control.

Overrides

select(boolean,boolean) in Control.

Form.setAcceptButton

Syntax
public void setAcceptButton( IButtonControl button );
Parameters
button
Control to use as the AcceptButton.
Description

Sets the control that is the AcceptButton. This control must implement IButtonControl to be used as the acceptButton.

See Also
getAcceptButton

Form.setActiveControl

Syntax
public void setActiveControl( Control value );
Parameters
value
Control to make active.
Description

Sets the control that is currently active.

See Also
getActiveControl

Form.setAutoScale

Syntax
public void setAutoScale( boolean value );
Parameters
value
Value for the AutoScale property.
Description

Sets the AutoScale property. When AutoScalling is turned on, the form will rescale the form based on the base font size when it is created. This makes the form display correctly on large font systems and systems that have a larger default font than what the form was designed on.

See Also
getAutoScale

Form.setAutoScaleBaseSize

Syntax
public void setAutoScaleBaseSize( int value );
Parameters
value
Value for AutoScaleBaseSize
Description

Sets the AutoScaleBaseSize. This value is used at form display time to compute the scaling factor for the form.

See Also
getAutoScaleBaseSize, setAutoScale

Form.setAutoScroll

Syntax
public void setAutoScroll( boolean value );
Parameters
value
Value for the AutoScroll property.
Description

Sets the AutoScroll property. When AutoScrolling is turned, scroll bars will be displayed on the form if any controls are located outside the client region of the form. This allows the user to scroll the client region to make the controls visible.

In addition, when AutoScrolling is on, the client region will automatically scroll to make the control with focus visible. This lets the user tab around the form and always see the control that has focus.

See Also
getAutoScroll, setAutoScrollMargin

Form.setAutoScrollMargin

Syntax
public void setAutoScrollMargin( Point value );
Parameters
value
Value for the AutoScrollMargin property.
Description

Sets the margins used during AutoScrolling. The margins define the width and height of the border around each control. This border is used to determine when scroll bars are needed on the form and where to scroll to when a control is selected.

See Also
getAutoAcrollMargin, setAutoScroll

Form.setAutoScrollPosition

Syntax
public void setAutoScrollPosition( Point value );
Parameters
value
Position for the AutoScroll region.
Description

Sets the default position of the AutoScroll region. This will not move the scroll region once the form has been created.

Form.setBorderStyle

Syntax
public void setBorderStyle( int borderStyle );
Parameters
borderStyle
New border style for the form. Must be a value from the FormBorderStyle class.
Description

Sets the border style for the form. Valid values are:


  FormBorderSytle.NONE
  FormBorderSytle.FIXED_SINGLE
  FormBorderSytle.SIZABLE
  FormBorderSytle.FIXED_DIALOG
  FormBorderSytle.FIXED_TOOLWINDOW
  FormBorderSytle.SIZABLE_TOOLWINDOW

See Also
getBorderStyle, wfc.ui.FormBorderStyle

Form.setCancelButton

Syntax
public void setCancelButton( IButtonControl button );
Parameters
button
Button to treat as the cancelButton.
Description

Sets the cancelButton for the Form. The cancelButton is "clicked" when the user presses ESC.

See Also
getCancelButton

Form.setClientSize

Syntax
public void setClientSize( Point clientSize );
Parameters
clientSize
Requested size of the client region.
Description

Sets the clientSize of the form. This will adjust the bounds of the form to make the clientSize the requested size.

Overrides

setClientSize(Point) in Control.

See Also
getClientSize

Form.setControlBox

Syntax
public void setControlBox( boolean controlBox );
Parameters
controlBox
Value for the ControlBox property.
Description

Sets the value for the ControlBox property. If ControlBox is set to true, there is an icon in the upper-left corner of the form that has the System menu on it.

See Also
getControlBox

Form.setDesktopBounds

Syntax 1
public void setDesktopBounds( Rectangle bounds );
Parameters
bounds
New bounds for the Form in desktop coordinates.
Description

Sets the bounds of the Form in desktop coordinates.

See Also
setDesktopBounds(int, int, int, int)



Syntax 2
public void setDesktopBounds( int x, int y, int width, int height );
Parameters
x
The x location for the form.
y
The y location for the form.
width
Width for the form.
height
Height for the form.
Description

Sets the bounds of the form in desktop coordinates. Desktop coordinates are based on the working area of the screen, which excludes the taskbar.

See Also
setDesktopBounds(Rectangle)

Form.setDesktopLocation

Syntax 1
public void setDesktopLocation( Point loc );
Parameters
loc
Location for the form.
Description

Sets the location of the form in desktop coordinates.

See Also
setDesktopLocation(int, int), setDesktopBounds(int, int, int, int)



Syntax 2
public void setDesktopLocation( int x, int y );
Parameters
x
The x location for the form.
y
The y location for the form.
Description

Sets the location of the form in desktop coordinates.

See Also
setDesktopLocation(Point), setDesktopBounds(int, int, int, int)

Form.setDialogResult

Syntax
public void setDialogResult( int value );
Parameters
value
Value to return.
Description

Sets the value that will be returned from the form when it is displayed as a modal dialog.

See Also
getDialogResult, showDialog

Form.setFormState

Syntax 1
protected final void setFormState( int flag, boolean value );
Parameters
flag
FORMSTATE_* property.
value
Set to true to turn property on; set to false to turn it off.
Description

This will turn all the bits on or off for the specified FORMSTATE_* property.

See Also
setFormState(int, int), getFormState, hasFormState



Syntax 2
protected final void setFormState( int flag, int value );
Parameters
flag
FORMSTATE_* property.
value
Value to set the property to.
Description

This will set the value of the specified FORMSTATE_* property.

See Also
setFormState(int, boolean), getFormState, hasFormState

Form.setHelpButton

Syntax
public void setHelpButton( boolean helpButton );
Parameters
helpButton
New value for the HelpButton property.
Description

Sets the HelpButton property. If HelpButton is true, a "What's This" Help icon will be displayed in the caption bar of the form.

See Also
getHelpButton

Form.setIcon

Syntax
public void setIcon( Icon icon );
Parameters
icon
Icon to display.
Description

Sets the icon to be displayed in the caption bar of the form.

See Also
getIcon

Form.setIsMDIContainer

Syntax
public void setIsMDIContainer( boolean value );
Parameters
value
New value for the IsMDIContainer property.
Description

Sets the value for the IsMDIContainer property. If this is set to true, this form can contain other forms in an MDI fashion.

See Also
getIsMDIContainer

Form.setKeyPreview

Syntax
public void setKeyPreview( boolean keyPreview );
Parameters
keyPreview
New value for the KeyPreview property.
Description

Sets the KeyPreview property. When KeyPreview is set to true, the form will recieve key events for all the contained controls before the control. This allows the form to catch events such as ENTER, and so forth.

See Also
getKeyPreview

Form.setMaxButton

Syntax
public void setMaxButton( boolean maxButton );
Parameters
maxButton
New value for the MaxButton property.
Description

Sets the value for the MaxButton property. If MaxButton is true, the maximize button is displayed in the caption bar of the form.

See Also
getMaxButton

Form.setMDIParent

Syntax
public void setMDIParent( Form form );
Parameters
form
Form to make this MDI parent of this form.
Description

Sets the MDIParent for this form. The MDIParent must be marked as an MDI container for this to succeed.

See Also
getMDIParent

Form.setMenu

Syntax
public void setMenu( MainMenu value );
Parameters
value
Menu for this form.
Description

Sets the main menu for this form.

See Also
getMenu

Form.setMinButton

Syntax
public void setMinButton( boolean minButton );
Parameters
minButton
New value for the MinButton property.
Description

Sets the value for the MinButton property. If MinButton is true, the minimize button is displayed in the caption bar of the form.

See Also
getMinButton

Form.setNewControls

Syntax
public void setNewControls( Control[] ctls );
Description

Topic under construction.

Overrides

setNewControls(Control[]) in Control.

Form.setOwner

Syntax
public void setOwner( Form owner );
Parameters
owner
New owner for this form.
Description

Sets the owner for this form. This is the same as calling owner.addOwnedForm(this).

See Also
getOwner, addOwnedForm, removeOwnedForm

Form.setPaletteMode

Syntax
public void setPaletteMode( int paletteMode );
Description

Sets the PaletteMode for the Form. Valid values are:


  FormPaletteMode.HALFTONE
  FormPaletteMode.NONE
  FormPaletteMode.USE_CONTORL

See Also
getPaletteMode, wfc.ui.FormPaletteMode

Form.setPaletteSource

Syntax
public void setPaletteSource( Control paletteSource );
Description

Sets the source for the form's palette if the Form PaletteMode is FormPaletteMode.USE_CONTROL.

See Also
getPaletteSource, setPaletteMode

Form.setParentHandle

Syntax
public void setParentHandle( int value );
Parameters
value
HWND of the new parent for this form.
Description

Sets the HWND parent of this form.

Overrides

setParentHandle(int) in Control.

Form.setShowInTaskbar

Syntax
public void setShowInTaskbar( boolean showInTaskbar );
Parameters
showInTaskbar
New value for the ShowInTaskbar property.
Description

Sets the ShowInTaskbar property. If ShowInTaskbar is true, the form will be displayed in the Windows taskbar.

See Also
getShowInTaskbar

Form.setStartPosition

Syntax
public void setStartPosition( int startPosition );
Parameters
startPosition
New value for the StartPosition.
Description

Sets the StartPosition for the form. Valid values are:


  FormStartPosition.MANUAL
  FormStartPosition.WINDOWS_DEFAULT_LOCATION
  FormStartPosition.WINDOWS_DEFAULT_BOUNDS
  FormStartPosition.CENTER_SCREEN

See Also
getStartPosition, wfc.ui.FormStartPosition

Form.setVisible

Syntax
public void setVisible( boolean value );
Parameters
value
Set to true if the form should be visible.
Description

Sets the visibility of the form.

Overrides

setVisible(boolean) in Control.

See Also
getVisible

Form.setWindowState

Syntax
public void setWindowState( int windowState );
Description

Sets the WindowState of the form. Valid values are:


  FormWindowState.NORMAL
  FormWindowState.MAXIMIZED
  FormWindowState.MINIMIZED

See Also
getWindowState, wfc.ui.FormWindowState

Form.showDialog

Syntax 1
public final int showDialog();
Return Value

Returns The DialogResult from the form.

Description

Shows this form as a modal dialog with no owner.

See Also
showDialog(Form)



Syntax 2
public final int showDialog( Form owner );
Parameters
owner
Form that will own the modal dialog.
Return Value

Returns The DialogResult from the form.

Description

Shows this form as a modal dialog with the specified owner.

See Also
showDialog()

Form.suspendUpdateMenuHandles

Syntax
protected void suspendUpdateMenuHandles();
Description

Increments updateMenuHandleSuspendCount.

See Also
resumeUpdateMenuHandles

Form.updateMenuHandles

Syntax
protected void updateMenuHandles( MainMenu menu, boolean forceRedraw );
Description

Topic under construction.

Form.updateStyles

Syntax
public void updateStyles();
Description

Topic under construction.

Overrides

updateStyles() in Control.

Form.wndProc

Syntax
protected void wndProc( Message m );
Parameters
m
Message sent.
Description

Base wndProc encapsulation.

Overrides

wndProc(Message) in Control.