How can i display a message box without any button (OK, YES, NO, Cancel, etc..) and it will disappear automatically?
for example...a message box with the word "Pls wait..." when a program is loading
Printable View
How can i display a message box without any button (OK, YES, NO, Cancel, etc..) and it will disappear automatically?
for example...a message box with the word "Pls wait..." when a program is loading
The simplest and expensive way is to add a form with, perhaps, a timer.
I do my own forms. I've a form that has a Label usually named as Info.
Info has autosize on, form is sizable toolbox, caption is empty.
Then there's this code (in the form, in this example Form2):
I call it like this:Code:Public Sub ShowMsg(Text As String)
'Called when the form is not visible
Dim NewWidth, NewHeight As Integer
Info = Text
NewWidth = Width - ScaleWidth + Info.Width + Info.Left * 2
NewHeight = Height - ScaleHeight + Info.Height + Info.Top * 2
Move (Screen.Width - NewWidth) / 2, (Screen.Height - NewHeight) / 2, NewWidth, NewHeight
Me.Show
Refresh
End Sub
You can't resize the window, because VB is doing something.Code:Private Sub Command1_Click()
Call Form2.ShowMsg ("Please wait, loading...")
'Some code
Unload Form2
End Sub
This looks quite cool :)
If you change this a bit, you can have icons, picture etc. in the message.
Hope this helps,
[Edited by MerryVIP on 10-19-2000 at 06:27 AM]
Try this:
Code:Private Sub Form_Load()
frmMain.Hide
Load frmLoad
' Do your stuff
DoEvents
Unload frmLoad
frmMain.Show
End Sub