Skip to content

OnCreate - cCJStatusBar

Event is called when the statusbar's COM object is created

Type: Event

Syntax

Procedure OnCreate

Description

The OnCreate event is called when the statusbar's COM object is created. At this point this object is bound to the COM object. This event can be used to send messages to the COM object allowing for special customizations not supported directly by other design-time properties.

Note that each statusbar pane object will also receive the OnCreate event.

See CreateComInstance for a description of the statusbar COM object creation process

Sample

In this sample OnCreate has been augmented to change the statusbar's default font weight to bold. All statusbar panes will now appear in bold font (unless the pane itself changes the font). This uses the cComStdFont object.

Procedure OnCreate
    Handle hoFont
    Variant vFont

    // create a font object and bind it to the statusbar
    Get Create U_cComStdFont to hoFont
    Get ComFont to vFont
    Set pvComObject of hoFont to vFont

    // set the font to bold 
    Set ComBold of hoFont to True

    // destroy the proxy object
    Send Destroy of hoFont
End_Procedure

This sample would require that you use StdFont.pkg in your project

Use StdFont.pkg