BBjFormElement::setHorizontalSticky

Description

In BBj 4.0 and higher, this method sets the horizontal sticky option. This option affects how the form element is positioned relative to the parent.

Syntax

Return Value

Method

void

setHorizontalSticky(int sticky)

Parameters

Variable

Description

sticky

Specifies the sticky option from element constants.

Return Value

None.

Remarks

None.

Example

rem 'Set horizontal sticky

rem 'Obtain the instance to the BBjAPI object
myAPI! = BBjAPI()

rem 'Obtain an instance of a default BBjPrinter object
let myBBjPrinter! = myAPI!.getBBjPrinter(0)

rem 'Get BBjForm for the selected printer
let myBBjForm! = myBBjPrinter!.getForm(0)

rem 'Get a new page
let myBBjFormPage! = myBBjForm!.createPage()

rem 'Get a new paragraph
let para! = myBBjFormPage!.newParagraph()

rem 'Set horizontal sticky
para!.setHorizontalSticky(para!.STICKY_CENTER)

rem 'Set vertical sticky
para!.setVerticalSticky(para!.STICKY_CENTER)

rem 'Set the text
para!.setText("This text should be in the center of the page")

rem 'Preview the form
myBBjFormPage!.add(para!)
myBBjForm!.preview()
release

See Also

BBjAPI

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.