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

windows 7 display in extended mode causes crash in VFP 9 SP 2

Status
Not open for further replies.

taterday

Programmer
Jan 28, 2009
183
US
I am using windows 7 on a laptop with a monitor configured as an extended display. Windows 7 will expand my application to fit the screen if I drag the application to the top of the screen. If I drag any of the open form displayed to the top of my laptop display, the apps crashes with.
example:

error with label1 - fontsize: expression evaluated to an illegal value

I using the "stretch" class. Is there an ability to increase/decrease the form size with crashing in Windows 7 extended display mode? Please help.
 
The error is very specific pointing out the issue: The stretch class you use highers the fontsize to an illegal, too high value. That should be easy to fix, by limiting it to a max allowed value, shouldn't it?

Solutions: Roll your own stretch, use Anchoring without font resizing. Or in try/error approach first find out what is the max fontsize accepted and change the code of the stretch class or your own code to not take the fontsize higher than that.

Bye, Olaf.
 
I did this for you:

_screen.FontSize = 1000
_screen.FontSize = 500
_screen.FontSize = 250
_screen.FontSize = 120
_screen.FontSize = 140
_screen.FontSize = 130
_screen.FontSize = 128
_screen.FontSize = 127

It's not a win7 issue, it's simply the fontsize should not get higher than 127. Your double width desktop and a rather big label in your original size form makes the stretch class compute a font size higher than the max 127, and then you get that error.

Bye, Olaf.
 
Thank you. I will look at the code and see if I trap for this.

I also, wanted to know if VFP 9 has a better resize. I saw the _resizeable.vcx. Has anyone used this?

Have you used this? Or what do you guys use to expand your form?
 
By the way, to go back to the original question, I personally don't think you should resize a label when you resize a form.

When you resize a form, you want to increase or decrease the areas in which the user interacts. So it's right to resize textboxes (but only horizontally), edit boxes, grids, etc. But I don't see the point of resizing a label. After all, it's still going to show the same information, regardless of its size.

Again, going back to the original question, if you do resize a label, you shouldn't be changing its font size. That's not resizing: it's zooming. The purpose of resizing is not to make fonts larger or smaller. The user can use Control Panel for that.

Just my opinion, for what it's worth. No doubt others will have different views.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike,

I agree. But people have different oppinions, some also like a resizer that does only resize all, including fontsizes.

A form looking okay on a 1024 pixel width display might look unreadable on a 1920 pixel wide display, and doing a 1:1 resize can help better in such situations, than anchoring.

I can also give you a good example: In an application users can transfer data to notebooks and work on them offline, and those devices changed to netbooks, because of the form factor and/or budget. The effect is, while the display of netbooks offer the same resolutions, the dpi is so much higher, that text get's too small to be readable. And that is even a situation you can't regulate with a 1:1 resizer.

Best of both worlds would be anchoring plus a seperate control of font widhts. Then users can accomodate higher or lower dpi and/or take advantage of more space for display of more data, more rows/columns, whatever suits best.

Bye, Olaf.



 
You guys are too good for me. I still don't know what to do. I know you understand what you are saying. All the example font sizes?

I will see if I can work with the sample form cresize.scx and work out my problem.

 
Thanks, Mike.

And the essence is, you can achieve that by Foxpros normal anchoring and a seperate Font resizer, in general.

The problem is in the details. But in the end I agree with you anchring is the better base technology and what we need on top of that is an intelligent font resizer.

Such a class should handle to highering fontsizes appropriate to the current form size, but in a more intelligent way than just 1:1 resizing. In my case for example I need higher font sizes despite of the same form size. So that class would need to know what controls can be reduced in their area to make room for larger fonts.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top