Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change the font size with Anchor property

Status
Not open for further replies.

ameedoo3000

IS-IT--Management
Sep 20, 2016
233
EG
Hello my friends...
How do I change the font size in the case enlarge the form using Anchor property ?
 
You can't, but you can add code in your form's Resize event. However, be warned since this is something most users hate these days. People buy big monitors in order to see many programs at one, and resizing the fonts will probably only make them angry. I know that I would...
 
be warned since this is something most users hate these days.

I completely agree. The purpose of the Anchor property is to resize the individual controls in sync with the user resizing the form. It is not a zoom control. By all means, provide a means for users to change the font size, but it has got nothing to do with resizing the form.

To put it another way, think how programs like Microsoft Word work. The user can resize the document window, and they can change the zoom factor. But these are two independent operations. Doing one of them does not affect the other.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I've done what you ask for in one application because it's what the customer asked for. They don't really like it, and fortunately, I attached it to a form-level property, so it's easy to turn off.

I've written about given users control over font and size:
Tamar
 
There is Markus Winhards mwresize class, which actually does what you want without even using anchoring. The class is older and hooks into the forms resize event.

I agree to the others, though, anchroning the way it is offers the option to eg let a grid display more lines, etc. and its intention is not zooming.

I'm old enough to also need reading glasses, but still have no problem at the distant of my displays, even at notebooks. I know the general Windows setting for bigger fonts is causing problems with many applications, but a mere zooming is not helpful, I agree this could be handled as two separate options.

Notice there is the [tt]Resize[/tt] event and you can react to the current size of controls affected by anchoring to eg change column widths of grids and listboxes, which is an appropriate action to take, if there are no columns scrolled off the visible grid area but the additional width just reaveals empty area. That can also be a case to limit the form/grid width, though.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top