|
-
Jun 19th, 2001, 04:38 AM
#1
Thread Starter
Junior Member
Refreshing a form
Hi
When any of my forms load then the data for the controls on the form is
loaded from my data layer dll's ( there are no bound controls).
However, the form takes several seconds to appear and looks untidy due to
the delay. I realise this is because Vb has switched processing to the data
but ideally I would like the form to load first. I can get round it by
putting a timer on the form and delaying the data load but this is messy. Is
there any other way I can do it using redraw methods or the api
Mnay thanks
Mark Foster
-
Jun 19th, 2001, 05:10 AM
#2
Frenzied Member
I tend to have a public variable which tells you that the form_Load() has completed successfully and only then show the form:
'Form code
Public FormLoaded As Boolean
Private Sub Form_Load()
'Load data stuff....
'inform process that the form has loaded OK
FormLoaded = True
End Sub
Then to load the form cleanly do thus:
Public Sub LoadModalFormCleanly(byval frm As Form)
While Not frm.FormLoaded Do
'\\ Wait for form to have completely loaded
DoEvents
Wend
frm.Show vbModal
End Sub
HTH,
D
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|