Dim MAIN_FR_ACTIV As Integer
Public Sub MainForm_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Activated
MAIN_FR_ACTIV = 1
End Sub
Private Sub MainForm_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
MAIN_FR_ACTIV = -10
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
EthernetIPforCLXCom1.Write("MIKE_STRING_1", MIKE_TBox1.Text)
EthernetIPforCLXCom1.Write("MIKE_STRING_2", MIKE_TBox2.Text)
EthernetIPforCLXCom1.Write("MIKE_MN_FR_ACTV", MAIN_FR_ACTIV)
End Sub
'************************************************************
'* This will guarantee that even hidden forms are all closed
'* when the main application is closed
'************************************************************
Private Sub DemoForm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Environment.Exit(0)
End Sub