Hi,
I know messagebox, msgbox functions are able to post messages, but they need user to send a result to messagebox. Now what i want is I need a messagebox to post information when a function or procedure is running on the background, and when this function or procedure finishs, this information box will disappear. For example, when my application is doing some save tasks, a information box is posted with text "saving now....", after saving is finished, information box is disappeared. Anybody knows how to it Thank you very much!

Messagebox
Patrice1974
It all depens on where you are putting your close statement....for example the following code works just fine:
Dim
f As New Form2 Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Timer1.Enabled = True Me.Timer1.Interval = 5000 f.ShowDialog() End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick f.Close() f.Enabled = False End SubIn your situation you can put the f.close statement in the backgroundworker completed event
SnowJim
Sorry,
I think your code is complicated. What I have done,
dim f as new frmmessage 'here frmmessage is predesigned form I need
f.label.text="saving now..."
f.show(me)
'the codes are running
............
...........
'when above codes are finished
f.close()
In frmMessage form,
Private Sub frmMessage_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus Me.Focus() End Subas a result, when frmmessage is active, I can prevent events, for example mouse event, however, I can't get the exact same function as done by showdialog(). I am not sure anybody knows how to that Please let me know
cgraus
Hi,
I tried that code before, it doesn't work. showdialog will wait for a answer from the windows form.
Shrek.NET
what you can do is show the form to the user, whilst everything is running on the other main form where the processing is happening, then once completed, close the message info form. This would be using the Show() method instead of ShowDialog().
You may want to hide the background form for the time being to make sure that the user does not interfere with the processes or maybe disable the entire form until the process has been completed perhaps. There are a couple of options.
you could also put perhaps some status bar on the main form and post your messages there for the user and disable the form or something to prevent them from clicking buttons...so they know that your app is doing something and the status is being shown as well as perhaps updating the Form's text (title bar)
irving at irvingevajoan
create your own modal form....
Declare the variable at class level...
Dim
f As New Form1Set the text and show the form when the thread starts...
f.Label1.Text = "Saving Now" f.ShowDialog(Me)Close the form when the thread completes...
f.Close()