openning a messagebox during form load

G

Guest

Any such thing as postopen event?

I have a form that loads data and after loading informs user of missing
information via a messagebox. My problem is that the messagebox appears
before the form opens. I would like the form to finish openning then have the
messagebox open on top of the form.



Thanks in advance.
 
H

Herfried K. Wagner [MVP]

Nkem said:
I have a form that loads data and after loading informs user of missing
information via a messagebox. My problem is that the messagebox appears
before the form opens. I would like the form to finish openning then have
the
messagebox open on top of the form.

\\\
Private Sub Form1_Activated( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Activated
Static IsActivated As Boolean
If Not IsActivated Then
IsActivated = True
Application.DoEvents()
MsgBox("Foo")
End If
End Sub
///
 
N

NuTcAsE

Just before you do MessageBox.Show (), write the following line of
code:

this.Visible = true;

This will ensure that the form is made visible before the message box
is shown. Its a hack but it works.

NuTcAsE
 
G

Guest

This did not work for me.By the way, the method that opens the messagebox is
called in the formLoad event?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top