Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Bob Brook
  Where is Bob Brook?
 Surrey
 United Kingdom
 Bob Brook
 Tags
Subject: RE: Totals at bottom of Grids
Thread ID: 396043 Message ID: 396055 # Views: 107 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Wednesday, January 22, 2014 3:00:58 PM         
   


> I have recently added Peter Sass's grid totals grid to forms in my applications.
> They work(ed) fine and I set the default height of the totgrid to 20px and would increase it to the height of the rows in the main grid plus twice the line height.
>
> On XP and some Windows 7 OS PC's this works without problem.
>
> Yesterday, received error messages numbered 2005 from a client using Windows 7.
>
> On investigation it turns out that the minimum height I was using of 20 was causing the error. If I set the totgrid classes height to 40 and in the SetPosition method use a Do Loop and a Try Catch EndTry structure on setting the totgrid height for an actual form with an incrementing variable to slowly increase the grids height. It overcomes the problem.
>
> On my XP system if I try to set a grid height of less than 20 under VFP - it gives an error.
> This is the 2005 error that the end user gets when running the program.
>
> I suppose my question is: why for some operating systems, what is in their environment that could cause a 2005 error on some PC's but not on others. It may also be a problem for some Windows 8 PC's but as yet none have reported an error.
>
> I suspected the style/type of Window display being used, but on changing to Windows Classic or Windows XP under the Control Panel, has no effect on the error.
>
>
> Regards
>
> Bob of Surrey, England



FWIW, when I'm getting Error 2005, I'm usually suspecting custom Resize() code being used instead of the Anchoring feature in the first place, and that Resize() code assigning illegal values.
So that perhaps something like the customizable scroll bar width / height in Windows display properties may for example make a difference for something like a Grid in Form.Resize()

* In a quick&dirty test, in TestForm.Resize() this one caused error 2005 when the Form got small:
Thisform.Grid1.Move( ;
	10, ;
	10, ;
	Thisform.Width - 20, ;
	Thisform.Height - 20 ;
	)

* This one did not:
Thisform.Grid1.Move( ;
	10, ;
	10, ;
	MAX(Thisform.Width - 20, 20 + SYSMETRIC(5)), ;
	MAX(Thisform.Height - 20, 20 + SYSMETRIC(8)) ;
	)




hth
-Stefan

ENTIRE THREAD

Totals at bottom of Grids Posted by Bob Brook @ 1/22/2014 2:14:53 PM
RE: Totals at bottom of Grids Posted by Stefan Wuebbe @ 1/22/2014 3:00:58 PM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/22/2014 4:34:42 PM
RE: Totals at bottom of Grids Posted by Pete Sass @ 1/22/2014 7:21:34 PM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/22/2014 8:41:16 PM
RE: Totals at bottom of Grids Posted by Pete Sass @ 1/22/2014 9:37:49 PM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/23/2014 11:22:21 AM
RE: Totals at bottom of Grids Posted by Vicos Vicos @ 1/24/2014 10:59:09 PM
RE: Totals at bottom of Grids Posted by Ilyas Ansar @ 1/24/2014 2:36:16 AM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/24/2014 11:24:20 AM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/24/2014 1:10:24 PM