Asynchronous Message Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

During the execution of my application, I want to pop up a message window to users in an asynchrounous way
Do somebody have a sample code

Thanks in advance
 
Hi Li Pang,
During the execution of my application, I want to pop up a message window
to users in an asynchrounous way. Do somebody have a sample code?

What do you mean by that, I really cannot understand what you mean with
messages in an asynchrounous way, you mean something as those anoying popup
windows on a page when you close a page and have timerinterval in it to
start the show something later?

Cor
 
Think about a program installation program. During the installation, showing users a window (with message like "please wait .." and a progressBar), when the installation completes, then close the message window. Either the installation or message window should be run in asynchronous way. I prefere to run the message window in asynchronous mode and the installation in synchronous mode

Li Pang
 
Hi Li

Display the message from a new thread, something like this..

\\Private Sub MyDisplayMessage(
MessageBox.Show("This is a message", "MyMessageBox"
End Su

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
Dim intCounter As Intege
Dim objThread As New Thread(AddressOf MyDisplayMessage

objThread.Start(

For intCounter = 1 To 1
Console.WriteLine("Processing" & StrDup(intCounter, ".")
Thread.CurrentThread.Sleep(1000
Nex
End Su
//

HTH
Gary
 
Hi Li,

Something like this?

Cor

\\\form1
Private frm As New Form2
Private Sub Form1_Load(ByVal sender _
As Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
frm.Show()
End Sub

///
\\\form2

Private WithEvents timer1 As New Windows.Forms.Timer
Private Sub Form2_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.ForeColor = Color.White
timer1.Enabled = True
timer1.Interval = 125
Me.BackColor = Color.CornflowerBlue
Me.Opacity = 1
Me.TopMost = True
Me.Text = "Splash"
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles timer1.Tick
Me.Opacity -= 0.01
If Me.Opacity = 0 Then
timer1.Enabled = False
Me.Close()
End If
End Sub
///
 
Hi Gary

Thanks for your help. BTW, do you have equivalent codes in VB6? I also need it in some no dot net app
 
Hi Li,

I also saw that the solution from Gary was very nice and is in my opinion
exactly answering your question. However there is no multithreading in VB6
and therefore the best is to ask this in a more classic VB newsgroup, there
are a lot.

microsoft.public.vb*

Cor
 
Back
Top