|
-
Dec 15th, 2007, 05:53 PM
#1
Thread Starter
Frenzied Member
[2005] NotifyIcon1.ShowBalloonTip() huge delay
NotifyIcon1.ShowBalloonTip() has a huge delay for me,
I will click the 'minimize' button, and my program's visibility is set to false, and then the balloon should show, but it doesn't happen at all most of the time... and sometimes it works properly, and then sometimes it takes 5-10 seconds...
My code:
vb.net Code:
Private Sub MinimizeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinimizeButton.Click
NotifyIcon1.ShowBalloonTip(5000)
Application.DoEvents()
Me.Visible = False
End Sub
Last edited by Icyculyr; Dec 16th, 2007 at 03:38 PM.
-
Dec 15th, 2007, 06:02 PM
#2
Frenzied Member
Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay
The documentation for it would be a great deal of help to you explain why this isn't working. Did you look at it yet?
Also, your signature doesn't compile =(
-
Dec 15th, 2007, 06:17 PM
#3
Thread Starter
Frenzied Member
Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay
Ok, I have looked at the documentation, the only code I added was this:
Code:
notifyIcon1.Visible = True
Is that correct? (I am testing now)
Also, your signature doesn't compile =(
Didn't you make the custom class VBCurrentPost? (lol)
-
Dec 15th, 2007, 06:29 PM
#4
Frenzied Member
Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay
 Originally Posted by Icyculyr
Didn't you make the custom class VBCurrentPost? (lol)
Hey! Don't lie to me! I saw you changing it from ElseIf to Else.
-
Dec 15th, 2007, 06:30 PM
#5
Thread Starter
Frenzied Member
Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay
http://www.vbforums.com/showthread.php?t=500987
:P
Any idea's...
The problem is still happening, I do not see why? is it because I am hiding my form?
-
Dec 15th, 2007, 07:41 PM
#6
Thread Starter
Frenzied Member
Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay
UPDATE: it has nothing to do with me setting my form's visibility to false.
I am not sure why this is happening, I have checked MSDN several times, and it says nothing of use to me...
?? my balloon does not show up straight away, and most of the time not at all!
-
Dec 15th, 2007, 08:48 PM
#7
Thread Starter
Frenzied Member
Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay
UPDATE:
I tried the below code but it acts ODD?!
Code:
Public Class Form1
Public NotifyIcon1 As New NotifyIcon()
Private Sub SetBalloonTip()
NotifyIcon1.Icon = SystemIcons.Exclamation
NotifyIcon1.BalloonTipTitle = "Balloon Tip Title"
NotifyIcon1.BalloonTipText = "Balloon Tip Text."
NotifyIcon1.BalloonTipIcon = ToolTipIcon.Error
NotifyIcon1.Visible = True
End Sub
Public Sub Form1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Click
NotifyIcon1.ShowBalloonTip(7000)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SetBalloonTip()
End Sub
End Class
Sometimes it lasts 10 seconds, sometimes it lasts 50 seconds?
Edit 1: I tested again, it lasts exactly 50 seconds...
Edit 2: It also does not show above any windows, meaning if I have mozilla firefox open, and I click the form, I hear the sound, but I see nothing, if I reduce mozilla I can see my balloon, any idea's why?
What's the deal? I timed it... lol
-
Dec 16th, 2007, 03:59 AM
#8
Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay
I just tested the code in post #7 and it worked perfectly, exactly as you'd expect. The balloon appeared and it displayed over any maximised or normal windows that may been occupying the lower, right corner of the screen.
One thing to note with the balloon tips on NotifyIcons, they are designed to guarantee that the user sees them. The timeout you specify is from the first user input detected while the balloon is visible. If your balloon appears and there is no mouse movement or keyboard input then the balloon will just stay there indefinitely. This ensures that if the user is away from their computer when the message appears it will still be visible to them when they return. That way they will not miss any important messages from your app. Once the mouse moves or a key is depressed the countdown will start.
Now, I also tried another test. I added a NotifyIcon to my form and set its Visible property to False. I then set the BalloonTipIcon, BalloonTipTitle and BalloonTipText properties. I then added this code:
vb.net Code:
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As EventArgs) Handles MyBase.Load
Me.NotifyIcon1.Icon = SystemIcons.Information
End Sub
Private Sub Form1_SizeChanged(ByVal sender As Object, _
ByVal e As EventArgs) Handles Me.SizeChanged
If Me.WindowState = FormWindowState.Minimized Then
Me.ShowInTaskbar = False
Me.NotifyIcon1.Visible = True
Me.NotifyIcon1.ShowBalloonTip(5000)
Else
Me.NotifyIcon1.Visible = False
Me.ShowInTaskbar = True
End If
End Sub
Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As Object, _
ByVal e As MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
Me.WindowState = FormWindowState.Normal
End Sub
I ran the project and minimised the form. The tray icon appeared and displayed the balloon as expected. I then double-clicked the icon and it disappeared, re-showing the form.
-
Dec 16th, 2007, 03:36 PM
#9
Thread Starter
Frenzied Member
Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay
Well, thanks, it must be my computer then o_O
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
|