|
-
Oct 19th, 2000, 04:12 AM
#1
Thread Starter
Member
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
-
Oct 19th, 2000, 04:52 AM
#2
Addicted Member
The simplest and expensive way is to add a form with, perhaps, a timer.
-
Oct 19th, 2000, 04:56 AM
#3
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):
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
I call it like this:
Code:
Private Sub Command1_Click()
Call Form2.ShowMsg ("Please wait, loading...")
'Some code
Unload Form2
End Sub
You can't resize the window, because VB is doing something.
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]
-
Oct 19th, 2000, 05:01 AM
#4
Junior Member
Try this:
Code:
Private Sub Form_Load()
frmMain.Hide
Load frmLoad
' Do your stuff
DoEvents
Unload frmLoad
frmMain.Show
End Sub
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
|