Imports System.IO.Ports

Public Class completeform


    Private Sub completeform_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        SerialPort1.Close()
        SerialPort1.PortName = sequential.ComTextBox.Text
        SerialPort1.BaudRate = 9600
        SerialPort1.DataBits = 8
        SerialPort1.Parity = Parity.None
        SerialPort1.StopBits = StopBits.One
        SerialPort1.Handshake = Handshake.None
        SerialPort1.Encoding = System.Text.Encoding.Default

        Dim Xpos As Integer
        Dim ypos As Integer

        Xpos = (Me.Width / 2) - (Panel1.Width / 2)
        ypos = (Me.Height / 2) - (Panel1.Height / 2)
        Panel1.Location = New Point(Xpos, ypos)

    End Sub


    Private Sub completeform_Click(sender As System.Object, e As System.EventArgs) Handles MyBase.Click
        sequential.Close()
        mountingForm.Enabled = True
        SerialPort1.Open()
        SerialPort1.Write("B")
        SerialPort1.Close()
        sequential.Timer1.Start()
        mountingForm.Timer3.Start()
        Me.Close()
    End Sub

    Private Sub Panel1_Click(sender As System.Object, e As System.EventArgs) Handles Panel1.Click
        sequential.Close()
        mountingForm.Enabled = True
        SerialPort1.Open()
        SerialPort1.Write("B")
        SerialPort1.Close()
        sequential.Timer1.Start()
        mountingForm.Timer3.Start()
        Me.Close()
    End Sub

    Private Sub Label1_Click(sender As System.Object, e As System.EventArgs) Handles Label1.Click
        sequential.Close()
        mountingForm.Enabled = True
        SerialPort1.Open()
        SerialPort1.Write("B")
        SerialPort1.Close()
        sequential.Timer1.Start()
        mountingForm.Timer3.Start()
        Me.Close()
    End Sub

    Private Sub Label2_Click(sender As System.Object, e As System.EventArgs) Handles Label2.Click
        sequential.Close()
        mountingForm.Enabled = True
        SerialPort1.Open()
        SerialPort1.Write("B")
        SerialPort1.Close()
        sequential.Timer1.Start()
        mountingForm.Timer3.Start()
        Me.Close()
    End Sub
End Class