Link to home
Start Free TrialLog in
Avatar of Tim313
Tim313Flag for United States of America

asked on

VB.Net - Form Loads but Label does not fill with text

I have a form (frmWaitProgressBar) that has 1 label and 1 progress bar. The label text is "Please wait while the Production Form loads...".

This form is called by another form using:

     Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
            frmWaitProgressBar.Show()
            frmWaitProgressBar.TopMost = True
            frmProd1.Show()
     End Sub

The form shows when called and the progress bar works, stepping through 20 blocks as called from frmProd1_Load event using   frmWaitProgressBar.pb1.PerformStep()  at 20 various points in the code.

All this is good, the problem is:

    The frmWaitProgressBar label shows but the text "Please wait while the Production Form loads..." that is supposed to be in the label does not, the label is blank.

If I call frmWaitProgressBar this way with the last line commented out:

     Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
            frmWaitProgressBar.Show()
            frmWaitProgressBar.TopMost = True
            'frmProd1.Show()
     End Sub

The form loads correctly with the label text showing.

What can I do to load frmWaitProgressBar and have the label text show when I call frmProd1.Show()?
Avatar of it_saige
it_saige
Flag of United States of America image

Sounds like you have a blocking call that is being made before you set the label text.  Could you provide the full code for all the forms you are concerned with and their designers (frmProd1, frmWaitProgress and the main form that is calling them)?

-saige-
ASKER CERTIFIED SOLUTION
Avatar of Tim313
Tim313
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not a problem.  Let us know if there is anything else you need assistance with.

-saige-
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
            frmWaitProgressBar.Show()
            frmWaitProgressBar.TopMost = True
            My.Application.DoEvents
            frmProd1.Show()
     End Sub
Avatar of Tim313

ASKER

Not a real solution to the label text problem, but got to go with what works.