AutoSize

Applies to

MonthCalendar controls and grDispAttr objects within Graph controls

Description

For MonthCalendar controls, when the AutoSize property is on, the calendar is sized to hold a single month. If you change other properties that affect size, such as TextSize and TodaySection, the calendar resizes automatically both at design time and runtime.

For grDispAttr objects, the AutoSize property allows PowerBuilder to change the font size of the text object automatically according to the amount of text being displayed. If automatic sizing is not enabled, you must set the text size.

Usage


In a painter

StepsTo enable automatic sizing of calendar controls:

  1. Select the AutoSize check box on the General page in the Properties view.

StepsTo enable automatic sizing of text objects in graphs:

  1. Display the Text tab page of the control’s Properties view.

  2. Select a text object from the Text Object list.

  3. Select the AutoSize check box.

    If you clear the AutoSize check box for a specific text object, set the text size for that object by selecting a value from the TextSize list.


In scripts

The AutoSize property takes a boolean value.

For the MonthCalendar control, AutoSize is true by default. This example turns autosizing off for a MonthCalendar control:

mc_1.AutoSize = false

For grDispAttr objects, AutoSize can be set using the grDispAttr object for each text component.

This example turns autosizing off for the graph control’s title and then sets a specific text size.

gr_1.TitleDispAttr.AutoSize = FALSE

gr_1.TitleDispAttr.TextSize = 10

This example turns autosizing off for the label of the Category Axis of the graph control and then sets a specific text size.

gr_1.Category.LabelDispAttr.AutoSize = FALSE

gr_1.Category.LabelDispAttr.TextSize = 8