Results 1 to 9 of 9

Thread: [2005] NotifyIcon1.ShowBalloonTip() huge delay

  1. #1

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    Resolved [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:
    1. Private Sub MinimizeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinimizeButton.Click
    2.         NotifyIcon1.ShowBalloonTip(5000)
    3.         Application.DoEvents()
    4.         Me.Visible = False
    5.     End Sub
    Last edited by Icyculyr; Dec 16th, 2007 at 03:38 PM.

  2. #2
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    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 =(

  3. #3

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    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)

  4. #4
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [2005] NotifyIcon1.ShowBalloonTip() huge delay

    Quote 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.

  5. #5

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    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?

  6. #6

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    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!

  7. #7

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    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

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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:
    1. Private Sub Form1_Load(ByVal sender As Object, _
    2.                        ByVal e As EventArgs) Handles MyBase.Load
    3.     Me.NotifyIcon1.Icon = SystemIcons.Information
    4. End Sub
    5.  
    6. Private Sub Form1_SizeChanged(ByVal sender As Object, _
    7.                               ByVal e As EventArgs) Handles Me.SizeChanged
    8.     If Me.WindowState = FormWindowState.Minimized Then
    9.         Me.ShowInTaskbar = False
    10.         Me.NotifyIcon1.Visible = True
    11.         Me.NotifyIcon1.ShowBalloonTip(5000)
    12.     Else
    13.         Me.NotifyIcon1.Visible = False
    14.         Me.ShowInTaskbar = True
    15.     End If
    16. End Sub
    17.  
    18. Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As Object, _
    19.                                          ByVal e As MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
    20.     Me.WindowState = FormWindowState.Normal
    21. 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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    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
  •  



Click Here to Expand Forum to Full Width