Jump to content

Recommended Posts

Posted (edited)

Hello!

I want to make an application for my network computers. I want to make they ping my server and return a balloon notifying pinging success/failure. This is almost done, but here comes the issue; When the application starts, I have a "pinging..."window. I want to hide this one when pinging attempt finishes, and I want to maintain notification icons on my systray. But the window does not hide with the Me.Hide command, or if I enter the Me.Close command, notification icons also disappear. Can somebody tell me what's wrong?

Here's my code:

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
NotifyIcon1.ShowBalloonTip(10000)
If My.Computer.Network.Ping("192.168.0.1", 5000) Then

NotifyIcon1.Visible = False
ntfSuccess.Visible = True
ntfSuccess.ShowBalloonTip(10000)
Me.Hide()
Else
NotifyIcon1.Visible = False
ntfFailure.Visible = True
ntfFailure.ShowBalloonTip(10000)
Me.Hide()
End If
End Sub

Thanks in advance!

Edited by ShinIori319

Posted

You can't hide the window during Form_Load using Me.Hide(), try moving all the code to Form_Shown instead. If it's because you never want the form to be shown at all, then try setting the form's visible property to false during design-time.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...