Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

11.4.2 Using Custom Methods and Properties in Controls

You have a number of properties and methods for this control that will be directly accessible to any ActiveX enabled application it may be plugged into.

The available methods and properties, however, are only those allowed for the form containing the control itself. You cannot access properties for individual controls within a form that may contain numerous other controls.

For example, you cannot change the font size of the DateBox or TimeBox static text controls contained in the clock control from an application that is using this control, nor may you change the background color of the form containing the data and time fields.

You may, however, create custom methods and/or properties for this control that will be directly accessible to any application that wishes to include this control.

Custom methods may in turn access properties for individual controls contained within that control.

A good example usage of a custom property might be to create a custom property called "DateFormat" that specifies which format the date should be displayed in. The application using the control could then set the DateFormat property at any time, and you could add additional code in the MyClock control's timer event procedure to format the date being displayed in various ways depending on the current value of the DateFormat property.

A good example usage of a custom method, might be a method that changes the current font in one of the static text controls contained within the clock control.

This would allow an application using the clock control to manipulate its static text control font properties indirectly.

Custom Events, Methods and Properties may be inserted into a control by right-clicking on a form name in the Project Manager and selecting the appropriate option from the context menu that appears. You may also insert custom methods or properties in a form by selecting the appropriate action under the Edit menu in the Project Manager, and then selecting the Object option, or from the Insert menu of the Form Editor.