0

I have been working on an applicatin that if the network connection is down the application's notification icon is supposed to show a balloon tooltip.

This application will also show the balloon tooltip when the network connection is re-established.

When the network connection is re-established the balloon tooltip shows like it's supposed, however, when the network connection is lost, the balloon tooltip won't show.

The part that doesn't work looks like this:

'If the previous network connection or ping was good and now isn't, show it

        If BadPing = 1 Then
            HeartbeatIcon.ShowBalloonTip(10000, "VPN Heartbeat", "Network Offline!", ToolTipIcon.Error)
        End If
        PingReplyText.Text += "Network Connection Offline!" + vbCrLf
        BadPing = BadPing + 1

So the program is checking for network connectivity every 10 seconds via a timer control that this 'If' statement resides in. If I change the 'If' statement to fire when BadPing = 2 I seem to be okay and the balloon tooltip shows, any less and it won't do it.

For testing purposes I commented out the 'If' statement and ran the program and the balloon tooltip showed up every 10 seconds, but only after PingReplyText had displayed "Network Connection Offline!" twice.

I am testing loss of network connectivity in this case by disabling my network adapter in the control panel of Windows. Is there something going on that I am not aware of that could be causing the balloon tooltip not to show up in the first 10 seconds of network loss?

Niroti
  • 1
  • 1

1 Answers1

0

Your explanation is not too clear, but BadPing will be more than 1 after the first loop, I mean, this message will be showed just one time.

Try also set the text in different way, since I have the same here and it's functioning like a charm:

        HeartbeatIcon.BallonTipTitke = "Heartbeat"
        HeartbeatIcon.BallonTipText = "Network Online"
        HeartbeatIcon.ShowBallonTip(10000)
David BS
  • 1,822
  • 1
  • 19
  • 35
  • Yes, the balloon tooltip will only show once, I did that by design. And yes, BadPing will be more than 1 after the first loop. Again I did that by design to force the program to check twice before declaring a bad connection. The issue I have is if I set it to only check once for the bad connection, I don't get the tooltip for some reason. If it helps, BadPing is initialized to zero when the program loads, then it is set to zero again once a good ping is received. – Niroti Feb 23 '16 at 23:54
  • The problem may be occurring with your version of Visual Studio - here everything works fine in a 30,000 lines app with a lot of calls to this control! Since I hope you're SURE about not disabling this control in any part of your app, which VS you have (and which Service Pack too)? – David BS Feb 24 '16 at 02:26
  • Well I appear to have fixed this problem. I think it had something to do with my user profile being redirected to our server, because when I published the app and installed it on a standalone tablet, it worked perfectly. – Niroti Feb 24 '16 at 20:40
  • Now the issue is getting it to show on a colleagues laptop. The published version of the app works on my tablet and PC but won't work on his laptop. Double checked to make sure that his notifications were turned on in the Windows settings. These are all Windows 10 devices by the way. The app was created in VS 2013 Express – Niroti Feb 24 '16 at 23:00
  • Did you tried to run in any Windows 8? The problem may be related to WIn 10. – David BS Feb 25 '16 at 10:16