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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can we zoom a window as with word or excel?

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hello to all.
For me one of the nice things of nowadays office applications is the zoom option which is done by holding ctrl-key and scroll mousewheel.
Is there any idea how to get this feature within VFP9?
TIA
-Bart
 
Bart,

The MouseWheel method lets you trap the spinning of the mouse wheel. Also, the method takes a parameter which tells you if Ctrl is being held down. So it is possible to detect the user doing this.

But after that, you're on your own. It's up to you what you want to happen when the user takes this action.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Craig and Mike,
I do know this is not a standard VFP feature.
I just thought (before starting to develop at my own) if already someone walked this road.

Now I overthink to update the 'full-screen' option as described in '1001 things'.
-Bart
 
Bart; its pretty simple if you have a resizer built in already, and the whole form is being resized, For just the controls (contents) and not the form, while do-able, involves quite a bit of coding and IMO not really worth the hassle. (we did look into it) The word wrap is the killer.
This concept is ideal for a edit box where there is automatic word wrap built in. for an edit box all you do is put this in the Mousewheel:

Code:
Lparameters nDirection, nShift, nXCoord, nYCoord
If nShift = 2 And nDirection > 0
	This.FontSize = This.FontSize + 1
	This.Refresh
Endif

If nShift = 2 And nDirection < 0
	This.FontSize = This.FontSize - 1
	This.Refresh
Endif
 
You've got to distinguish between a resize and zoom. Imaginecorp's code will zoom the control which has focus, which might be what you want.

If you want to zoom the entire form, that will be more complicated. Resizing the form is relatively easy (in VFP 9.0), thanks to the Anchor property, but you've got to ask yourself if that's the behaviour the user would expect to see.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
And I'll just add .... If you let the use spin the wheel to zoom or resize, you really should also let them use the wheel to scroll. That would be easy for grids, but I'm not sure how easy it would be for forms or editboxes.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
I will proceed with the resizer.
In "1001 things" there is code which shows how to blow up a form to the screen borders. The result is a zoomed window.
Zooming in just a control is not what I'm looking for, as I try to mimic the office-behaviour.
I have also seen applications with a toolbar button which pops-up a window with enlarged 'current control'.

Thanks for your comments.
-Bart
 
Bart,

I have also seen applications with a toolbar button
which pops-up a window with enlarged 'current control'.

That sounds like a good possibility.

I have a custom edit box class which consists of an edit box plus a zoom button. The user can either type directly into the box, or they can zoom, in which case a new (modal) form opens. The form contains a resizable edit box, which is bound to the same control source as the smaller one. The larger box also has separate controls to adjust the text size and do a spellcheck.

However, I'm not sure if many of my users actually use this. I think it would be worth trying a toolbar button instead, as it might be more intuitive (and take up less space, as you only need one button, not one for each edit box).

If you try this, let us know how it works.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top