Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: FoxPro FAQ

Forms & Screen

How to I make something Resize when the _SCREEN.Resize event fires? by wgcs
Posted: 12 Nov 02 (Edited 10 Oct 03)

This has been tackled in a number of ways... the most common being creating a timer on the child form that repeatedly checks to see if _SCREEN.Height and _SCREEN.Width have changed.  

VFP8's BINDEVENT() probably is going to be the "Documented" way of doing this.
Update: VFP8 SP1 Deliberately disables the method of hooking the _SCREEN events described here due to instability of VFP when using this method.

However, still, the most elegant and simplest method I've seen is best demonstrated with code:

*Credit for this method must be given to the following:
*Fred Taylor - ElZorro 4/10/2001 www.elzorro.org
*with thanks to "Michel Roy" roym@jonar.com from the
*News Group microsoft.public.fox.programmer.exchange
* In your main program:
_Screen.AddObject("oResizer", "Resizer")

DEFINE CLASS Resizer AS Custom
  oScreen = _Screen
  KeyPreview = .t.

  PROCEDURE oScreen.Resize
    WAIT window "Resizing" NOWAIT

  FUNCTION oScr.Click && Works

  FUNCTION oScr.DblClick && Works
    * Note that Click fires first!

  PROCEDURE oScr.KeyPress && Works
  LPARAMETERS nKeyCode, nShiftStat, nKeyCode, nShiftStat

  PROCEDURE oScr.QueryUnload
    NODEFAULT && Hmmm, doesn't work like a form's does.
    WAIT WINDOW NOWAIT "QueryUnload!"

  PROCEDURE oScr.RightClick && Works
    DO testmenu.mpr

  PROCEDURE oScr.MyMethod && Works
    * This fires on _SCREEN.MyMethod() !!
    wait window "my method fired!"


See also: http://fox.wikis.com/wc.dll?Wiki~ScreenMethods
and http://fox.wikis.com/wc.dll?Wiki~ScreenResize

Back to Microsoft: FoxPro FAQ Index
Back to Microsoft: FoxPro Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close