I do't want more froms in my aplicattion, just a msgbox that I can call like me.mousepointer or something like this
Main Topics
Browse All TopicsHi everybody
i'm writting a vb application, and I need to show a message while some code is executing, like a msgbox but without buutons, and also i want to show or hide it without any user action. How can I do it?
Thank for your responses!!!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Consider the following code (it's from the API Guide application www.allapi.net)
...it will create a window.... then when the DestroyWindow method is called close the window.
Option Explicit
Const WS_EX_STATICEDGE = &H20000
Const WS_EX_TRANSPARENT = &H20&
Const WS_CHILD = &H40000000
Const CW_USEDEFAULT = &H80000000
Const SW_NORMAL = 1
Private Type CREATESTRUCT
lpCreateParams As Long
hInstance As Long
hMenu As Long
hWndParent As Long
cy As Long
cx As Long
y As Long
x As Long
style As Long
lpszName As String
lpszClass As String
ExStyle As Long
End Type
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Dim mWnd As Long
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim CS As CREATESTRUCT
'Create a new label
mWnd = CreateWindowEx(WS_EX_STATI
Me.Caption = mWnd
'Show our label
ShowWindow mWnd, SW_NORMAL
End Sub
Private Sub Form_Unload(Cancel As Integer)
'destroy our label
DestroyWindow mWnd
End Sub
joboy is near, but that's not the solution I need. I need a floating window to put a text like "Wait, please" when some code is executing, but I don't want to use more forms in my aplicattion, just a modal window message to put on the top while the code is executing.
anyway thankyou for your responses and hope you understand what I need.
A Messagebox function with or without buttons is still
adding (at least the net effect of) another form to your application.
If you insist on doing this way then make your own component
insert the objects on the Form publish whatever events you want
etc and use the component in your app.
You might be able to solve this by using the API graphics functions to
draw directly on the Desktop if you want the please wait to be on
top of all other windows without making your form Modal.
If you don't want to do it that way then exit the function that
draws the graphics at the beginning if the form does not have
focus.
You can even make a bitmap with your message and use the API
to display it, just call the function to display it on a Timer event.
for the raw code you will see a section similar to this
Friend WithEvents Button1 As System.Windows.Forms.Butto
Friend WithEvents TextBox1 As System.Windows.Forms.TextB
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TextBox2 As System.Windows.Forms.TextB
Friend WithEvents TextBox3 As System.Windows.Forms.TextB
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Button2 As System.Windows.Forms.Butto
add to this
Friend WithEvents lblMessage As System.Windows.Forms.Label
below that will be a sub
<System.Diagnostics.Debugg
add to that
Me.lblMessage = New System.Windows.Forms.Label
below that in the same sub will be a section for describing the control
add this
'
'lblMessage
'
Me.lblMessage.Location = New System.Drawing.Point(160, 184)
Me.lblMessage.Name = "lblMessage"
Me.lblMessage.Size = New System.Drawing.Size(152, 56)
Me.lblMessage.TabIndex = 8
Me.lblMessage.Text = "myMessage"
Me.lblMessage.Visible = False ' this will make it invisible
(let me know if you need more controls, ie colour etc.)
you must know the code well enough to say when you want the message to pop up.
In those areas use the code
lblMessage.Visible = True
-- do your stuff ---
lblMessage.Visible = False
Hope this helps and is what you were looking for.
Business Accounts
Answer for Membership
by: srimanthPosted on 2003-09-04 at 05:46:52ID: 9287587
why would you want a messagebox to do that?
Also, when u display a messagebox, all other calls from your project would be blocked until a user intervention is done. If you want to display probably a progress bar to just inform the user that something is happening, then i would suggest the following:
create a form without any elements on it. Insert just a progress bar on it. Then show it as a modal form. So, the user will not be able click anywhere else, but would have to wait until u unload the form programatically from your form. If you want to remove the Min, Max and "X" buttons, then set its ClipControls and ControlBox to False.
If you want some help with the code, do shout.
cheers,
srimanth.