Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: Saeed Paksima
  Where is Saeed Paksima?
 Kish Island
 Iran
 Saeed Paksima
 Tags
Subject: RE: GRID Flashing Problem
Thread ID: 16008 Message ID: 16038 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Monday, October 07, 2002 11:06:49 PM         
   


> > > > hello Saeed, maybe you can try the following code in timer event, which quoted from other visitors:
> > > >
> > > >
> > > > with thisform
> > > >    .LockScreen = .T.
> > > >    .yourgrid.refresh
> > > >    .Lockscreen = .F.
> > > > 

> > > >
> > > > hope this help
> > > >
> > > > waifoong
> > >
> > >
> > > That wouldn't solve the problem. I'd tried it before .
> > >
> > >
> >
> >
> > Try the LockWindowUpdate function instead
> >
> > I'll assume you are using VFP7 in order to get the hWnd of the form. You would put this in a function.....
> >
> >
> > FUNCTION LockWindow
> > 
> > LPARAMETERS tnhWnd
> > 
> > DECLARE INTEGER LockWindowUpdate IN USER32 INTEGER nHandle
> > 
> > IF VARTYPE(tnhWnd) = "N"
> > 	LockWindowUpdate(tnhWnd)
> > ELSE
> > 	LockWindowUpdate(0)
> > ENDIF
> > 
> > RETURN
> > 

> >
> >
> > ..and then call it with...
> >
> >
> > LockWindow(Thisform.hWnd)
> > Thisform.Grid.Refresh()
> > LockWindow()
> > 

> >
>
> Hi Paul,
>
> Thanks for the idea.I think what you suggested is actually the mechanics of the native LockScreen method. Anyway, I tried it but the same result ! Grid flashes everytime I refresh it .
>
> Saeed Paksima

* ---------------------------------------------------------------------------------------------
Hi,
OK.... as a last resort...... have been watching this thread !
In the timer event.....
Set the darn grid visible property to .f.
Provide a messagebox advise the user of the requery...or something like that
After the re-query is done ... remove the messagebox
Make the grid visible again
Set the focus back to the gird

I am not sure how to handle getting your record pointer back to the original
record, as there is a possibity the record could have been deleted in a
multi-user environment. In any event, store the key value to a memory
variable in the timer even and attempt to seek on it when the re-query is done.
Use the If .Not. Found() function after the re-query.
SEEK mykeyvalue
IF .NOT. FOUND()
GOTO TOP
THISFORM.GRID1.REFESH
THISFORM.GRID1.COLUMN1.SETFOCUS
ENDIF

ps... I actually call a form while the re-query happens
with a message on it "Please wait...updating data !" not a messagebox

I have a generic form in all apps that allow me to provide more capability
than the messagebox function.... and use a memory variable to pass the
message to the one generic form. See below:

cindexkey=Your key field
THISFORM.GRID1.VISIBLE=.F.
cmess_string="PLease Wait... Updating Data !"
DO FORM Messagefrm
Wait "" TIMEOUT .25
..... Requery()... or whatever you are doing to populate the grid
THISFORM.GRID1.VISIBLE=.T.
SEEK cindexkey
IF .NOT. FOUND()
GOTO TOP
ENDIF
RELEASE WINDOW Messagefrm
THISFORM.GRID1.REFESH
THISFORM.GRID1.COLUMN1.SETFOCUS

Set the Messagefrm as modeless and the Wait for 1/4 second
is to ensure the form fills fully. If the processor is too busy the
form may only partially be filled. Have this form set for autocenter.

Does this help your problem.... ????

Pete from the Great White North ! (Only in Canada, ay...) Over and Out ...


ENTIRE THREAD

GRID Flashing Problem Posted by Saeed Paksima @ 10/6/2002 6:24:58 PM
RE: GRID Flashing Problem Posted by liew wai foong @ 10/6/2002 7:53:13 PM
RE: GRID Flashing Problem Posted by Saeed Paksima @ 10/7/2002 6:46:34 AM
RE: GRID Flashing Problem Posted by Paul Brown @ 10/7/2002 11:04:48 AM
RE: GRID Flashing Problem Posted by Saeed Paksima @ 10/7/2002 11:42:39 AM
RE: GRID Flashing Problem Posted by Pete Sass @ 10/7/2002 11:06:49 PM