-
Aug 20th, 2014, 12:56 AM
#1
Thread Starter
Frenzied Member
NotifyIcon balloon disappearing before timeout
I am displaying a system tray balloon via a NotifyIcon. I am setting the timeout to the maximum with:
NotifyIcon.ShowBalloonTip(Int32.MaxValue)
yet the balloon is disappearing within 10 seconds.
-
Aug 20th, 2014, 01:10 AM
#2
Re: NotifyIcon balloon disappearing before timeout
Sometimes I wish that i could automatically send an electric shock over the internet to anyone who hasn't read the documentation. It took me about 7 seconds to display the MSDN documentation for the ShowBalloonTip method and a couple of seconds later I was reading this:
Minimum and maximum timeout values are enforced by the operating system and are typically 10 and 30 seconds, respectively, however this can vary depending on the operating system. Timeout values that are too large or too small are adjusted to the appropriate minimum or maximum value.
When it was so easy to find that information, why haven't you read it already?
-
Aug 20th, 2014, 01:42 AM
#3
Thread Starter
Frenzied Member
Re: NotifyIcon balloon disappearing before timeout
I recently upgraded a VS2005 application to VS2013. I think that this behaviour has changed. You used to be able to set a large number which effectively meant it remained visible until the user dismissed it. I have tried relatively small numbers like 15,000 and 30,000 which should display the balloon for 15 and 30 seconds but it is still disappearing after about 5 seconds in each case.
-
Aug 20th, 2014, 01:46 AM
#4
Re: NotifyIcon balloon disappearing before timeout
What Framework version? What OS?
-
Aug 20th, 2014, 01:48 AM
#5
Thread Starter
Frenzied Member
Re: NotifyIcon balloon disappearing before timeout
-
Aug 20th, 2014, 01:52 AM
#6
Re: NotifyIcon balloon disappearing before timeout
Does a brand new project behave the same way?
-
Aug 20th, 2014, 02:21 AM
#7
Thread Starter
Frenzied Member
Re: NotifyIcon balloon disappearing before timeout
Yes it does. This is the code I am using.
Code:
With NotifyIcon1
.Visible = True
.Text = "Lorem ipsum dolor"
.BalloonTipTitle = "Lorem ipsum dolor"
.BalloonTipIcon = ToolTipIcon.Info
.BalloonTipText = "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
.ShowBalloonTip(30000)
End With
-
Aug 20th, 2014, 02:47 AM
#8
Re: NotifyIcon balloon disappearing before timeout
I incorporated your code into an app like this:
vb.net Code:
Public Class Form1 Private timer As Stopwatch Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click With NotifyIcon1 .Visible = True .Text = "Lorem ipsum dolor" .BalloonTipTitle = "Lorem ipsum dolor" .BalloonTipIcon = ToolTipIcon.Info .BalloonTipText = "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." .ShowBalloonTip(30000) End With End Sub Private Sub NotifyIcon1_BalloonTipShown(sender As Object, e As EventArgs) Handles NotifyIcon1.BalloonTipShown Me.timer = Stopwatch.StartNew() End Sub Private Sub NotifyIcon1_BalloonTipClosed(sender As Object, e As EventArgs) Handles NotifyIcon1.BalloonTipClosed MessageBox.Show(Me.timer.ElapsedMilliseconds.ToString()) End Sub End Class
It was on Windows 8.1 Update but, no matter what value I used when calling ShowBalloonTip, I always got a value about 9360 displayed.
-
Aug 20th, 2014, 02:49 AM
#9
Thread Starter
Frenzied Member
Re: NotifyIcon balloon disappearing before timeout
It would seem there is a bug.
-
Aug 20th, 2014, 06:00 AM
#10
Re: NotifyIcon balloon disappearing before timeout
Originally Posted by robertx
It would seem there is a bug.
Since the documentation says, "Minimum and maximum timeout values are enforced by the operating system and are typically 10 and 30 seconds, respectively, however this can vary depending on the operating system.", it probably isn't a bug if the notification shows for 10 or 30 seconds.
-
Aug 20th, 2014, 07:24 AM
#11
Re: NotifyIcon balloon disappearing before timeout
Originally Posted by dbasnett
Since the documentation says, "Minimum and maximum timeout values are enforced by the operating system and are typically 10 and 30 seconds, respectively, however this can vary depending on the operating system.", it probably isn't a bug if the notification shows for 10 or 30 seconds.
I'll test on some other OSes and other versions of .NET when I get the chance but I'd say that it's what the OS wants rather than a bug.
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
|