Thanks for the ideas. Here is what I ended up doing (a combination of ideas
received)
use the API to get the user's screen resolution: (this is well documented if
you use google)
goapp.nScreenHeight
goapp.nScreenWidth
Then put this in your form class init:
********************* resolution new code *********************
Local ;
llVertical, ;
llHorizontal
If This.Height > (goapp.nScreenHeight - 42)
llVertical = .T.
Endif
If This.Width > (goapp.nScreenWidth - 42)
llHorizontal = .T.
Endif
Do Case
Case llVertical And llHorizontal
This.AutoCenter = .F.
This.Height = goapp.nScreenHeight - 42
This.Width = goapp.nScreenWidth - 42
This.Top = 2
This.Left = 2
This.ScrollBars = 3 && both vertical and horizontal
Case llVertical
This.AutoCenter = .F.
This.Height = goapp.nScreenHeight - 42
This.Top = 2
This.Width = This.Width + 8 && to allow for the vertical scroll bar
This.ScrollBars = 2 && vertical
Case llHorizontal
This.AutoCenter = .F.
This.Left = 2
This.Width = goapp.nScreenWidth - 42
This.ScrollBars = 1 && horizontal
Endcase
----- Original Message -----
From: "MB Software Solutions,LLC" <[email protected]>
To: "ProFox Email List" <[email protected]>
Sent: Monday, July 19, 2010 11:32 PM
Subject: Re: Screen resolution, scroll bars, etc
Andrew Stirling wrote:
> Mike
> I have:
> Form Init
> this.nborderstyle = 3
> this.ScrollBars= 3
> *DODEFAULT()
>
> Form Activate
> IF this.Height + 100 >_vfp.Height &&-100 < this.Height
> this.Top = 3
> this.Height = _vfp.Height-110 &&_screen.Height-40
> ENDIF
> IF this.width + 60 >_vfp.width &&-50 < this.width
> this.Left = 3
> this.width = _vfp.width-50
> ENDIF
>
> This pops up a scroll bar if the form is bigger than the screen
> availability.
> Obviously best to put this in your default form class.
Cool. I never designed scrolling forms; heard via here years ago that I
thought they were problematic, so I avoided them.
--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/0acc01cb283c$6afaa0f0$7a00a...@w2k3s02
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.