W
woo_derek
Hi everyone,
I'm having a bit of an issue with a popup toast window.
I have an application that starts up as a component application.
I'm doing this because I need it to run in the system tray for most of
the time. And of course, if you double click the icon, a main form
shows up.
My application shows status windows as toast popups, just like
Outlook does for when you get a new mail message.
I first had a problem with the controls not showing up properly.
They were showing up as black rectangles. I read an earlier post that
solved that problem for me. I just needed to call Application.DoEvents
after the Form.Show call.
http://groups.google.com/group/micr...on+form+vb+.net&rnum=1&hl=en#7d007dfc745d0c58
I have a Timer object running that will fire off this form when it
needs to notify the user of the status. The form will come up and
display, but whenever I put my mouse over it, I end up seeing the
Hourglass cursor (Wait cursor). I don't explicitly set the cursor.
Also, I have a link label on the popup form and can't click it, because
of the wait cursor. Any ideas how I can get around this. I have some
code below to show you what I'm doing. This code will pretty much give
you a gist of what I'm doing. I have a message loop running with a
timer. The timer elapses, then if I need to show the status window, I
show it. The status window displays, but I have no functionality of
that status window. It appears that it's on a locked thread. Is there
anyway to get it on another thread? Thanks to anyone who could help.
<System.STAThread()> _
Public Shared Sub Main()
Dim myCmpApp As cmpMain
'Run the message loop
myCmpApp = New cmpMain
System.Windows.Forms.Application.Run()
myCmpApp.Dispose()
End Sub
Private Sub tmrPollQueue_Elapsed(ByVal sender As System.Object, ByVal e
As System.Timers.ElapsedEventArgs) Handles tmrPollQueue.Elapsed
'Stop the timer during the loading period
Me.tmrPollQueue.Stop()
'I run some logic here that determine whether to show the
status window
If showWindow Then
Me.ShowNotificationWindow
End If
'Now that we're done, restart the timer
Me.tmrPollQueue.Start()
End Sub
Private Sub ShowNotificationWindow()
'Pop up the notification window
Dim f As New frmNotify
'Set the location of the form
f.Left = Screen.PrimaryScreen.WorkingArea.Right - f.Width
f.Top = Screen.PrimaryScreen.WorkingArea.Bottom - f.Height
f.Show()
Application.DoEvents()
End Sub
Derek Woo
I'm having a bit of an issue with a popup toast window.
I have an application that starts up as a component application.
I'm doing this because I need it to run in the system tray for most of
the time. And of course, if you double click the icon, a main form
shows up.
My application shows status windows as toast popups, just like
Outlook does for when you get a new mail message.
I first had a problem with the controls not showing up properly.
They were showing up as black rectangles. I read an earlier post that
solved that problem for me. I just needed to call Application.DoEvents
after the Form.Show call.
http://groups.google.com/group/micr...on+form+vb+.net&rnum=1&hl=en#7d007dfc745d0c58
I have a Timer object running that will fire off this form when it
needs to notify the user of the status. The form will come up and
display, but whenever I put my mouse over it, I end up seeing the
Hourglass cursor (Wait cursor). I don't explicitly set the cursor.
Also, I have a link label on the popup form and can't click it, because
of the wait cursor. Any ideas how I can get around this. I have some
code below to show you what I'm doing. This code will pretty much give
you a gist of what I'm doing. I have a message loop running with a
timer. The timer elapses, then if I need to show the status window, I
show it. The status window displays, but I have no functionality of
that status window. It appears that it's on a locked thread. Is there
anyway to get it on another thread? Thanks to anyone who could help.
<System.STAThread()> _
Public Shared Sub Main()
Dim myCmpApp As cmpMain
'Run the message loop
myCmpApp = New cmpMain
System.Windows.Forms.Application.Run()
myCmpApp.Dispose()
End Sub
Private Sub tmrPollQueue_Elapsed(ByVal sender As System.Object, ByVal e
As System.Timers.ElapsedEventArgs) Handles tmrPollQueue.Elapsed
'Stop the timer during the loading period
Me.tmrPollQueue.Stop()
'I run some logic here that determine whether to show the
status window
If showWindow Then
Me.ShowNotificationWindow
End If
'Now that we're done, restart the timer
Me.tmrPollQueue.Start()
End Sub
Private Sub ShowNotificationWindow()
'Pop up the notification window
Dim f As New frmNotify
'Set the location of the form
f.Left = Screen.PrimaryScreen.WorkingArea.Right - f.Width
f.Top = Screen.PrimaryScreen.WorkingArea.Bottom - f.Height
f.Show()
Application.DoEvents()
End Sub
Derek Woo