Form delay

NigelShaw

Registered User.
Local time
Today, 23:03
Joined
Jan 11, 2008
Messages
1,575
Hi

i am struggling with a slight form delay. When it opens on the OnOpen event, i am populating a grid. This takes about 3 to 5 seconds but, the it also takes the form the same time to open. What i need to do is get the form to open then populate the grid.

Can i make the form open first then populate?


thanks

Nigel
 
You can use the timer event of the form to populate the grid. Start it at whatever interval you want, then in your code set the timer interval to 0 so it doesn't run again.
 
Another technique might be the trick of opening the form invisible, complete populating the form, then make it visible.
 
Something else to try:-

Code:
Private Sub Form_Open(Cancel As Integer)

    Me.Repaint
    ' Or...
    Me.Visible = True
    DoEvents
    
    ' Draw the grid...
    
End Sub

Chris.
 
Hi,

I delayed the form code by 1/2 second. The form opens then 1/2 second later, populated the grid perfectly. Instead of closing the form, i made it invisible to prevent this every time the form opens. Here is a video of it :)

http://www.youtube.com/watch?v=sjoMQspE4ag

Thanks

Nigel
 

Users who are viewing this thread

Back
Top Bottom