Form not displaying correctly

  • Thread starter Thread starter Simon Verona
  • Start date Start date
S

Simon Verona

I have a class that provides functionality that is around my application.

One function it provides is a "PleaseWait" method, which displays a popup please wait form.

This works as a pair of functions as follows:

Dim _frmPleasewait As frmPleasewait
Public Sub PleaseWait(ByVal Text As String)
_frmPleasewait = New frmPleaseWait(Text)
_frmPleasewait.Show()
End Sub
Public Sub PleaseWaitClear()
_frmPleasewait.Hide()
_frmPleasewait.Dispose()
End Sub
the frmPleaseWait is added to this class and is simple form with a label on it. The New constructor takes a parameter which it sets the label.text equal to.

It is used in other forms in code such as.

Dim cls as new class
cls.pleasewait("Please wait whilst processing")
....
....
....
cls.PleaseWaitClear.


What happens is that the pleasewait form pops up correctly, but the label box is completely transparent (ie you can see the form underneath through it!!!).

Any ideas what I could have done wrong???

Thanks in advance
Simon
 
Simon said:
What happens is that the pleasewait form pops up correctly, but the
label box is completely transparent (ie you can see the form
underneath through it!!!).

Have you set the TransparencyKey property of your form? If you have, any
colours on the form will be completely transparent as you describe, and will
show the windows behind as if there was a hole in the form.

If that is the problem, you can clear it by right-clicking the
TransparencyKey property in the Properties window and selecting Reset.
 
Simon Verona said:
I have a class that provides functionality that is around my
application.

One function it provides is a "PleaseWait" method, which displays a
popup please wait form.

This works as a pair of functions as follows:

Dim _frmPleasewait As frmPleasewait
Public Sub PleaseWait(ByVal Text As String)
_frmPleasewait = New frmPleaseWait(Text)
_frmPleasewait.Show()
End Sub
Public Sub PleaseWaitClear()
_frmPleasewait.Hide()
_frmPleasewait.Dispose()
End Sub
the frmPleaseWait is added to this class and is simple form with a
label on it. The New constructor takes a parameter which it sets
the label.text equal to.

It is used in other forms in code such as.

Dim cls as new class
cls.pleasewait("Please wait whilst processing")
...
...
...
cls.PleaseWaitClear.


What happens is that the pleasewait form pops up correctly, but the
label box is completely transparent (ie you can see the form
underneath through it!!!).

Any ideas what I could have done wrong???


You are doing this:
....
....
....
Therefore the label does not have the time to paint itself. Solution: After

_frmPleasewait.Show()
add
_frmPleasewait.Refresh


Armin
 
I've checked this and the TransparencyKey property looks ok...

Any other thoughts?

Thanks
Simon
 
Back
Top