Link to home
Start Free TrialLog in
Avatar of amird
amird

asked on

changing the font size..

how do i change the font size of all the objects on a form

without writing for each object "<object>.font.size=<size>"

Avatar of mark2150
mark2150

If you set the forms font size at design time then all controls will inherit that size as you add them.

You can also "lasso" a group of controls (or select all with <Ctrl A>) and change thier font as a group.

At runtime, you're going to have to iterate thru the Controls collection changing the fonts as you go. Not all controls support a font size so you'll need a little bypass logic to skip control types that don't support font size property. Basic loop will be:

dim ctrl as object

for each ctrl in controls
  ctrl.fontsize = whatever
next ctrl

If you're dynamically resizing a forms' controls as the user changes rez, this is generally not a good idea. If you're doing it in response to an operator controlled selection, then that is better.

M

Avatar of amird

ASKER

there is still a problem with the size of the contols that doesnt changed accordingly to the change in the font size
ASKER CERTIFIED SOLUTION
Avatar of mark2150
mark2150

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial