When I create my form (from code below) and then move my form
right so only a bit of form shows on the right side of desktop,
then click on desktop and then click on form, it will move itself
left ( i think to try to center w/ right edge of desktop).

A browse window will not do this. Adding any other object will
not do this. ONly a GRID object.

Why?, and how can I stop this? Is this a bug? THX, Mike Farnesi (vfp8)


*SELECT ANYTABLE
PUBLIC MYFRM
MYFRM=CREATEOBJECT('MYFORM')
MYFRM.VISIBLE=.T.

DEFINE CLASS MYFORM AS FORM
*---------------------
PROCEDURE INIT
THISFORM.AddObject('MYOB','GRID') && try other Object
THISFORM.MYOB.VISIBLE=.T.
ENDPROC
ENDDEFINE

Re: strange FORM behavior by Dan

Dan
Mon Aug 09 15:26:17 CDT 2004

What version of VFP?

Doesn't do it for me. (VFP8, sp1)

Dan

Mike Farnesi wrote:
> When I create my form (from code below) and then move my form
> right so only a bit of form shows on the right side of desktop,
> then click on desktop and then click on form, it will move itself
> left ( i think to try to center w/ right edge of desktop).
>
> A browse window will not do this. Adding any other object will
> not do this. ONly a GRID object.
>
> Why?, and how can I stop this? Is this a bug? THX, Mike Farnesi
> (vfp8)
>
>
> *SELECT ANYTABLE
> PUBLIC MYFRM
> MYFRM=CREATEOBJECT('MYFORM')
> MYFRM.VISIBLE=.T.
>
> DEFINE CLASS MYFORM AS FORM
> *---------------------
> PROCEDURE INIT
> THISFORM.AddObject('MYOB','GRID') && try other Object
> THISFORM.MYOB.VISIBLE=.T.
> ENDPROC
> ENDDEFINE



RE: strange FORM behavior by turiya36

turiya36
Mon Aug 09 16:47:01 CDT 2004

Doesn't happen to me with VFP 7 sp1.

Is the form supposed to be a top-level form? Moving a non-top level form
around doesn't move it near the desktop, since it stays within the main vfp
_screen.


"Mike Farnesi" wrote:

> When I create my form (from code below) and then move my form
> right so only a bit of form shows on the right side of desktop,
> then click on desktop and then click on form, it will move itself
> left ( i think to try to center w/ right edge of desktop).
>
> A browse window will not do this. Adding any other object will
> not do this. ONly a GRID object.
>
> Why?, and how can I stop this? Is this a bug? THX, Mike Farnesi (vfp8)
>
>
> *SELECT ANYTABLE
> PUBLIC MYFRM
> MYFRM=CREATEOBJECT('MYFORM')
> MYFRM.VISIBLE=.T.
>
> DEFINE CLASS MYFORM AS FORM
> *---------------------
> PROCEDURE INIT
> THISFORM.AddObject('MYOB','GRID') && try other Object
> THISFORM.MYOB.VISIBLE=.T.
> ENDPROC
> ENDDEFINE
>

Re: strange FORM behavior by Sietse

Sietse
Mon Aug 09 16:49:33 CDT 2004

Mike,
Do you have any code or properties set in the Myform class?
HTH,
Sietse Wijnker


"Dan Freeman" <spam@microsoft.com> wrote in message
news:OgUI07kfEHA.3916@TK2MSFTNGP11.phx.gbl...
> What version of VFP?
>
> Doesn't do it for me. (VFP8, sp1)
>
> Dan
>
> Mike Farnesi wrote:
> > When I create my form (from code below) and then move my form
> > right so only a bit of form shows on the right side of desktop,
> > then click on desktop and then click on form, it will move itself
> > left ( i think to try to center w/ right edge of desktop).
> >
> > A browse window will not do this. Adding any other object will
> > not do this. ONly a GRID object.
> >
> > Why?, and how can I stop this? Is this a bug? THX, Mike Farnesi
> > (vfp8)
> >
> >
> > *SELECT ANYTABLE
> > PUBLIC MYFRM
> > MYFRM=CREATEOBJECT('MYFORM')
> > MYFRM.VISIBLE=.T.
> >
> > DEFINE CLASS MYFORM AS FORM
> > *---------------------
> > PROCEDURE INIT
> > THISFORM.AddObject('MYOB','GRID') && try other Object
> > THISFORM.MYOB.VISIBLE=.T.
> > ENDPROC
> > ENDDEFINE
>
>



Re: strange FORM behavior by Leemi

Leemi
Mon Aug 09 16:58:13 CDT 2004

Hi Mike:

Try running the code after issuing a SET RESOURCE OFF and booting in Safe
mode. Might this be a problem with the Foxuser file or the video driver?

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003

>What version of VFP?

>Doesn't do it for me. (VFP8, sp1)

>Dan

>Mike Farnesi wrote:
> When I create my form (from code below) and then move my form
> right so only a bit of form shows on the right side of desktop,
> then click on desktop and then click on form, it will move itself
> left ( i think to try to center w/ right edge of desktop).
>
> A browse window will not do this. Adding any other object will
> not do this. ONly a GRID object.
>
> Why?, and how can I stop this? Is this a bug? THX, Mike Farnesi
> (vfp8)
>
>
> *SELECT ANYTABLE
> PUBLIC MYFRM
> MYFRM=CREATEOBJECT('MYFORM')
> MYFRM.VISIBLE=.T.
>
> DEFINE CLASS MYFORM AS FORM
> *---------------------
> PROCEDURE INIT
> THISFORM.AddObject('MYOB','GRID') && try other Object
> THISFORM.MYOB.VISIBLE=.T.
> ENDPROC
> ENDDEFINE


Re: strange FORM behavior by mfarnesi

mfarnesi
Mon Aug 09 22:05:03 CDT 2004

i'm using:

-VFP8 sp1
-resource is off or on, doesn't matter.
-no code or properties, only the sample code i listed.

but there must be a table open in the selected work area
when you run the code.

make sure you move the form off the right side of desktop
leaving on partial form showing, then click on desktop
then click back on form.

-Mike Farnesi

Re: strange FORM behavior by Leonid

Leonid
Tue Aug 10 01:37:15 CDT 2004

I have two applications (VFP6SP5). I can reproduce it in one of them, but
not in another. The difference between them is that first have

Thisform.MyGrid.Setfocus

in the Activate method

Leonid


"Mike Farnesi" <mfarnesi@hotmail.com> wrote in message
news:26d24e2e.0408091137.347ecb50@posting.google.com...
> When I create my form (from code below) and then move my form
> right so only a bit of form shows on the right side of desktop,
> then click on desktop and then click on form, it will move itself
> left ( i think to try to center w/ right edge of desktop).
>
> A browse window will not do this. Adding any other object will
> not do this. ONly a GRID object.
>
> Why?, and how can I stop this? Is this a bug? THX, Mike Farnesi (vfp8)
>
>
> *SELECT ANYTABLE
> PUBLIC MYFRM
> MYFRM=CREATEOBJECT('MYFORM')
> MYFRM.VISIBLE=.T.
>
> DEFINE CLASS MYFORM AS FORM
> *---------------------
> PROCEDURE INIT
> THISFORM.AddObject('MYOB','GRID') && try other Object
> THISFORM.MYOB.VISIBLE=.T.
> ENDPROC
> ENDDEFINE



Re: strange FORM behavior by Leonid

Leonid
Tue Aug 10 02:19:05 CDT 2004

Here is a reproducable example (VFP6SP5, VFP9B)

close data all
create cursor MyCursor (F1 C(3))
PUBLIC MYFRM
MYFRM=CREATEOBJECT('MYFORM')
MYFRM.VISIBLE=.T.
MYFRM1=CREATEOBJECT('MYFORM')
MYFRM1.VISIBLE=.T.
read events

DEFINE CLASS MYFORM AS FORM

PROCEDURE INIT
THISFORM.AddObject('MYOB','GRID')
THISFORM.AddObject('MYOB1','textbox')
THISFORM.MYOB.top=40
THISFORM.MYOB1.top=10
THISFORM.MYOB.VISIBLE=.T.
THISFORM.MYOB1.VISIBLE=.T.
ENDPROC

PROCEDURE UNLOAD
if _screen.formcount=1
CLEAR EVENTS
endif
ENDPROC

ENDDEFINE


Run this code. Then Move Myform2 to the right so that only approximately 1
cm is visible. Click Myform1. Click Myform2 in the textbox. Nothing happens.
Click Myform1. Click Myform2 in the grid. Myform2 moves to the left. This
effect also can be noticed if you move form to the top so that half of
header isn't seen, or to the left. Didn't notice it at the upper side.

Leonid


"Leonid" <leonid@NOgradaSPAM.lv> wrote in message
news:uVNd7RqfEHA.3148@TK2MSFTNGP10.phx.gbl...
> I have two applications (VFP6SP5). I can reproduce it in one of them, but
> not in another. The difference between them is that first have
>
> Thisform.MyGrid.Setfocus
>
> in the Activate method
>
> Leonid
>
>
> "Mike Farnesi" <mfarnesi@hotmail.com> wrote in message
> news:26d24e2e.0408091137.347ecb50@posting.google.com...
> > When I create my form (from code below) and then move my form
> > right so only a bit of form shows on the right side of desktop,
> > then click on desktop and then click on form, it will move itself
> > left ( i think to try to center w/ right edge of desktop).
> >
> > A browse window will not do this. Adding any other object will
> > not do this. ONly a GRID object.
> >
> > Why?, and how can I stop this? Is this a bug? THX, Mike Farnesi (vfp8)
> >
> >
> > *SELECT ANYTABLE
> > PUBLIC MYFRM
> > MYFRM=CREATEOBJECT('MYFORM')
> > MYFRM.VISIBLE=.T.
> >
> > DEFINE CLASS MYFORM AS FORM
> > *---------------------
> > PROCEDURE INIT
> > THISFORM.AddObject('MYOB','GRID') && try other Object
> > THISFORM.MYOB.VISIBLE=.T.
> > ENDPROC
> > ENDDEFINE
>
>



Re: strange FORM behavior by Stefan

Stefan
Tue Aug 10 02:40:10 CDT 2004

Curious, it seems the grid is "proud to present" the data.
Happens with any form containing a grid in any version at least
back to Vfp5, doesn't it? It does not even matter if you activate
the form by mouse click or Ctrl+F1 keys.


-Stefan

Forwarded to MS.
My guess is it might turn out to be "by design"

* form_unintended_move.prg
&& run this and then activate the new form to make it jump

PUBLIC oForm as Form
oForm = CREATEOBJECT('TestForm')
*!* oForm.Visible = .T.
oForm.Show()

oForm.Move(_screen.Width-20,0)
* form with grid does not want to move so far,
* so we move it manually
ACTIVATE WINDOW command
KEYBOARD 'oForm.Left = oForm.Left + 1'
KEYBOARD '{ENTER}'

RETURN

DEFINE CLASS TestForm as Form
PROCEDURE Init
CREATE CURSOR temp (f1 I, f2 I)
INSERT INTO temp VALUES (1,1)
This.AddObject('oGrid','Grid')
This.oGrid.Visible = .T.
ENDPROC
ENDDEFINE
*


"Mike Farnesi" <mfarnesi@hotmail.com> schrieb im Newsbeitrag
news:26d24e2e.0408091905.3a99ceba@posting.google.com...
> i'm using:
>
> -VFP8 sp1
> -resource is off or on, doesn't matter.
> -no code or properties, only the sample code i listed.
>
> but there must be a table open in the selected work area
> when you run the code.
>
> make sure you move the form off the right side of desktop
> leaving on partial form showing, then click on desktop
> then click back on form.
>
> -Mike Farnesi


Re: strange FORM behavior by Stefan

Stefan
Tue Aug 10 03:22:34 CDT 2004


"Leonid" <leonid@NOgradaSPAM.lv> schrieb im Newsbeitrag
news:uVNd7RqfEHA.3148@TK2MSFTNGP10.phx.gbl...
> I have two applications (VFP6SP5). I can reproduce it in one of them, but
> not in another. The difference between them is that first have
>
> Thisform.MyGrid.Setfocus
>
> in the Activate method

Hi Leonid,

That does not seem to work with the "form_unintended_move.prg"
from the other posting, does it for you?


-Stefan


Re: strange FORM behavior by Leonid

Leonid
Tue Aug 10 04:56:18 CDT 2004

Hi, Stefan

I beleive that moving occurs when grid gets focus. Try simply

PUBLIC oForm as Form
oForm = CREATEOBJECT('TestForm')
*!* oForm.Visible = .T.
oForm.Show()

RETURN

DEFINE CLASS TestForm as Form
PROCEDURE Init
CREATE CURSOR temp (f1 I, f2 I)
INSERT INTO temp VALUES (1,1)
This.AddObject('oGrid','Grid')
This.oGrid.Visible = .T.
ENDPROC
ENDDEFINE
*

Then move form with the mouse to the right side and then press Ctrl+Tab. In
this case form isn't deactivated and activated.

Leonid

"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:2nreucF3lbtrU2@uni-berlin.de...
>
> "Leonid" <leonid@NOgradaSPAM.lv> schrieb im Newsbeitrag
> news:uVNd7RqfEHA.3148@TK2MSFTNGP10.phx.gbl...
> > I have two applications (VFP6SP5). I can reproduce it in one of them,
but
> > not in another. The difference between them is that first have
> >
> > Thisform.MyGrid.Setfocus
> >
> > in the Activate method
>
> Hi Leonid,
>
> That does not seem to work with the "form_unintended_move.prg"
> from the other posting, does it for you?
>
>
> -Stefan
>



Re: strange FORM behavior by Ook

Ook
Tue Aug 10 09:25:00 CDT 2004

If you add a command button to the form and set the focus to the command
button, this does not happen. I would chalk it up to more VFP Grid
weirdness. There are certain times when a form will do this, but the rules
are unclear, and appear to be hard coded in VFP, unknown to the developer,
possibly not even known to MS themselves anymore..

"Mike Farnesi" <mfarnesi@hotmail.com> wrote in message
news:26d24e2e.0408091137.347ecb50@posting.google.com...
> When I create my form (from code below) and then move my form
> right so only a bit of form shows on the right side of desktop,
> then click on desktop and then click on form, it will move itself
> left ( i think to try to center w/ right edge of desktop).
>
> A browse window will not do this. Adding any other object will
> not do this. ONly a GRID object.
>
> Why?, and how can I stop this? Is this a bug? THX, Mike Farnesi (vfp8)
>
>
> *SELECT ANYTABLE
> PUBLIC MYFRM
> MYFRM=CREATEOBJECT('MYFORM')
> MYFRM.VISIBLE=.T.
>
> DEFINE CLASS MYFORM AS FORM
> *---------------------
> PROCEDURE INIT
> THISFORM.AddObject('MYOB','GRID') && try other Object
> THISFORM.MYOB.VISIBLE=.T.
> ENDPROC
> ENDDEFINE



Re: strange FORM behavior by mfarnesi

mfarnesi
Tue Aug 10 13:27:38 CDT 2004

those of you who can't reproduce this: try:
the form must be moved to less than half of its width to
the right edge of desktop.

(this behavior is the same on the left edge of desktop).

Mike Farnesi

Re: strange FORM behavior by Stefan

Stefan
Wed Aug 11 05:23:34 CDT 2004


"Leonid" <leonid@NOgradaSPAM.lv> schrieb im Newsbeitrag
news:%238NUPBsfEHA.4092@TK2MSFTNGP10.phx.gbl...
> Hi, Stefan
>
> I beleive that moving occurs when grid gets focus.

Yes, I think so too.

Mike,
As a kludgy workaround, this seems to work

DEFINE CLASS TestGrid as Grid
PROCEDURE When
RETURN Thisform.Left < _screen.Width - 50
ENDPROC
ENDDEFINE


hth
-Stefan