Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Imports System.IO.Ports
Imports System.Text.RegularExpressions
Imports WindowsApplication1.HPRT.Printer

Namespace WindowsApplication1
    Partial Public Class PrtWinDemoForm
        Inherits Form
        Public PageModePrinterList As New List(Of String)()
        Private printer As HPRTPrinter = Nothing
        Private isPageModePrinter As Boolean
        Private imagePath As String
        Private Index As Integer
        Public Sub New()
            InitializeComponent()
            setButtonEnable(False)
            Me.cmbPortType.SelectedIndex = 1
            Me.cmbModel.Text = "MPT-III"
            Me.cmbModel.Focus()
            Me.txtPortSetting.Text = "USB"
            Me.cmbImage.SelectedIndex = 0
        End Sub
        Private Sub setButtonEnable(ByVal isEnable As Boolean)
            btnConnect.Enabled = Not isEnable
            btnStop.Enabled = isEnable
            Me.grbBtn.Enabled = isEnable
        End Sub
        Private Sub btnClose_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnClose.Click
            Me.Close()
        End Sub
        Private Sub btnConnect_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnConnect.Click
            Dim modelsetting As String = Me.cmbModel.Text
            Dim portsetting As String = Me.txtPortSetting.Text
            If printer Is Nothing Then
                printer = New HPRTPrinter(modelsetting)
                If printer Is Nothing Then
                    MessageBox.Show("Creator Model Failed!")
                    Return
                End If
            Else
                printer.Model = modelsetting
            End If
            If Constants.E_SUCCESS = printer.PortOpen(portsetting) Then
                Me.tboxInfo.Text = "Connect Succeed"
                setButtonEnable(True)
                PageModePrinterList.Add(modelsetting)
                isPageModePrinter = PageModePrinterList.Contains(modelsetting)
                If Not isPageModePrinter Then
                    Me.btnPrintLabel.Enabled = False
                End If
            Else
                MessageBox.Show("Port Failed!")
            End If
        End Sub
        Private Sub btnStop_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnStop.Click
            Me.tboxInfo.Text = "Close Port"
            printer.PortClose()
            setButtonEnable(False)
        End Sub
        Private Sub btnPrintLabel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPrintLabel.Click
            Dim vMotion As Double = 0.0625, hMotion As Double = 0.125
            Dim pageWidth As Integer = 50, pageHeight As Integer = 100
            Dim width_dots As Integer = CType((pageWidth / hMotion), Integer)
            Dim height_dots As Integer = CType((pageHeight / vMotion), Integer)
            Dim font_width As Integer = 12
            If CheckPrinterState() Then
                printer.Initialize()
                printer.SelectPageMode()
                printer.SetPageModePrintArea(0, 0, width_dots, height_dots)
                printer.SetPageModePrintDirection(Constants.PRINT_DIRECTION_LEFT_TO_RIGHT)
                printer.SetPageModeHorizontalPosition(0)
                printer.SetPageModeVerticalPosition(0)
                printer.PrintText("EXPRESS" & vbLf, Constants.ALIGNMENT_LEFT, Constants.TEXT_FONT_REVERSE, Constants.TEXT_SIZE_1WIDTH Or Constants.TEXT_SIZE_1HEIGHT)
                printer.SetPageModeHorizontalPosition(width_dots - 11 * font_width)
                printer.SetPageModeVerticalPosition(0)
                printer.PrintText("POSTAL 2015" & vbLf, Constants.ALIGNMENT_LEFT, Constants.TEXT_NORMAL_MODE, Constants.TEXT_SIZE_0WIDTH Or Constants.TEXT_SIZE_0HEIGHT)
                printer.SetPageModeHorizontalPosition(width_dots - 12 * font_width)
                printer.SetPageModeVerticalPosition(108)
                printer.PrintText("DOMESTIC EMS", Constants.ALIGNMENT_LEFT, Constants.TEXT_NORMAL_MODE, Constants.TEXT_SIZE_0WIDTH Or Constants.TEXT_SIZE_0HEIGHT)
                printer.SetPageModeHorizontalPosition(52)
                printer.SetPageModeVerticalPosition(240)
                printer.PrintText("Address", Constants.ALIGNMENT_LEFT, Constants.TEXT_NORMAL_MODE, Constants.TEXT_SIZE_0WIDTH Or Constants.TEXT_SIZE_0HEIGHT)
                printer.SetPageModeHorizontalPosition(0)
                printer.SetPageModeVerticalPosition(500)
                printer.PrintBarCode(Constants.BARCODE_CODE128, "{A123456", 2, 50, Constants.ALIGNMENT_LEFT, Constants.BARCODE_HRI_BELOW)
                printer.SetPageModeHorizontalPosition(330)
                printer.SetPageModeVerticalPosition(452)
                printer.PrintBarCode(Constants.SYMBOL_QRCODE1, "Addressee 123456", 3, 50, Constants.ALIGNMENT_LEFT, Constants.BARCODE_HRI_NONE)
                printer.SetPageModeHorizontalPosition(0)
                printer.SetPageModeVerticalPosition(710)
                printer.PrintSymbol(Constants.SYMBOL_STANDARD_PDF417, "China 0123456 ABC +_*&", Constants.PDF417_ERROR_CORRECTION_LEVEL_0, 3, 2, Constants.ALIGNMENT_LEFT)
                printer.PrintAndReturnStandardMode()
            End If
        End Sub
        Private Sub btnDirectIO_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDirectIO.Click
            Dim writedata As Byte() = New Byte() {&H1D, &H72, &H1}
            Dim readnum As Integer = 0
            Dim readdata As Byte() = New Byte(1) {}
            printer.DirectIO(writedata, readdata, readdata.Length, readnum)
            If readnum > 0 Then
                tboxInfo.Text = ""
                Dim i As Integer = 0
                While i < readnum
                    tboxInfo.Text += Convert.ToString(readdata(i), 16) + " "
                    System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
                End While
            End If
        End Sub
        Private Sub btnState_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRealTimeStatus.Click
            Dim printer_state As UInteger = 0
            printer.CheckPrinterState(printer_state)
            If Constants.STS_NORMAL = printer_state Then
                MessageBox.Show("Printer state is normal.")
            Else
                CheckPrinterState()
            End If
        End Sub
        Private Sub btnPrintReceipt_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPrintReceipt.Click
            If CheckPrinterState() Then
                printer.Initialize()
                printer.SetAlign(Constants.ALIGNMENT_CENTER)
                printer.PrintNVImageCompatible(1, 1)
                printer.PrintText("Receipt" & vbLf, Constants.ALIGNMENT_CENTER, Constants.TEXT_NORMAL_MODE, Constants.TEXT_SIZE_1WIDTH Or Constants.TEXT_SIZE_1HEIGHT)
                printer.PrintText("09/27/2014" & vbLf, Constants.ALIGNMENT_CENTER, Constants.TEXT_FONT_BOLD, Constants.TEXT_SIZE_1WIDTH Or Constants.TEXT_SIZE_1HEIGHT)
                printer.PrintText("LG-67441634" & vbLf, Constants.ALIGNMENT_CENTER, Constants.TEXT_FONT_BOLD, Constants.TEXT_SIZE_1WIDTH Or Constants.TEXT_SIZE_1HEIGHT)
                printer.PrintText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss " & vbLf), Constants.ALIGNMENT_LEFT, Constants.TEXT_NORMAL_MODE, Constants.TEXT_SIZE_0WIDTH Or Constants.TEXT_SIZE_0HEIGHT)
                printer.PrintText("Random Code：1234     Total：150" & vbLf, Constants.ALIGNMENT_LEFT, Constants.TEXT_NORMAL_MODE, Constants.TEXT_SIZE_0WIDTH Or Constants.TEXT_SIZE_0HEIGHT)
                printer.PrintText("Seller:12345678" & vbLf, Constants.ALIGNMENT_LEFT, Constants.TEXT_NORMAL_MODE, Constants.TEXT_SIZE_0WIDTH Or Constants.TEXT_SIZE_0HEIGHT)
                printer.PrintBarCode(Constants.BARCODE_CODE128, "{B10306AB100010", 2, 50, Constants.ALIGNMENT_CENTER, Constants.BARCODE_HRI_NONE)
                printer.PrintTwoQRCodeS(16, "AA1234000410403260040000000850000008c0000000053897589M+x3/vNm46Lv1GPel+1Fg==:**********:1:1:1:Price:1:140", "LG-67441634")
                printer.FeedLine(2)
                printer.PrintText("001  Number:214102201002" & vbLf, Constants.ALIGNMENT_LEFT, Constants.TEXT_NORMAL_MODE, Constants.TEXT_SIZE_0WIDTH Or Constants.TEXT_SIZE_0HEIGHT)
                printer.CutPaper(Constants.FULL_CUT, 10)
            End If
        End Sub
        Private Function CheckPrinterState() As Boolean
            Dim printerState As New PrinterState()
            printer.GetState(printerState)
            tboxInfo.Text = ""
            If printerState.PAPEREMPTY = True Then
                MessageBox.Show("Printer paper not present,please insert the printing paper.")
                Return False
            End If
            If printerState.COVEROPEN = True Then
                MessageBox.Show("Printer paper cover open,please check paper cover.")
                Return False
            End If
            If printerState.PAPERNEAREND = True Then
                tboxInfo.Text = "Printer paper near end,please insert the printing paper."
            End If
            If printerState.MSR_READY = True Then
            End If
            If printerState.SMARTCARD_READY = True Then
            End If
            If printerState.[ERROR] = True Then
                MessageBox.Show("Printer state error,please verify printer communication is normal.")
                Return False
            End If
            If printerState.NOT_OPEN = True Then
                MessageBox.Show("Printer port not open.")
                Return False
            End If
            If printerState.OFFLINE = True Then
                MessageBox.Show("Printer offline,please check the priner state.")
                Return False
            End If
            Return True
        End Function
        Private Sub cmbPortType_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles cmbPortType.SelectedIndexChanged
            Dim porttype As String = Me.cmbPortType.Text.ToUpper()
            If "COM" = porttype Then
                Me.txtPortSetting.Text = "COM1,BAUDRATE_19200"
            ElseIf "NET" = porttype Then
                Me.txtPortSetting.Text = "Net,192.168.1.37"
            ElseIf "USB" = porttype Then
                Me.txtPortSetting.Text = "USB"
            ElseIf "LPT" = porttype Then
                Me.txtPortSetting.Text = "LPT1"
            Else
                Me.txtPortSetting.Text = "Invalid"
            End If
        End Sub
        Private Sub btnWinFont_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnWindowsFont.Click
            If CheckPrinterState() Then
                Dim imgepath As String = Application.StartupPath + "\sample.bmp"
                printer.PrintText2Image(imgepath, "打印测试", FontStyle.Regular, 25)
                printer.PrintText2Image(imgepath, " اختبار الطباعة ", FontStyle.Underline, 25)
                printer.PrintText2Image(imgepath, "กรุณาเปิดดูวิดีโอใ", FontStyle.Bold, 25)
                printer.PrintText2Image(imgepath, "프린터 시험", FontStyle.Strikeout, 40)
            End If
        End Sub
        Private Sub btnVersion_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnVersion.Click
            Dim Version As Integer() = New Integer(3) {}
            If HPRT.Printer.Constants.E_SUCCESS = printer.GetPrinterVersion(Version) Then
                MessageBox.Show("Printer FirmwareVersion:" + Version(0).ToString() + "." + Version(1).ToString() + "." + Version(2).ToString())
            End If
        End Sub
        Private Sub btnDownLoadImage_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDownLoadImage.Click
            If CheckPrinterState() Then
                Dim result As Integer = 0
                Dim dlg As New OpenFileDialog()
                dlg.Filter = "Image files|*.bmp;*.gif;*.jpg;*.png;"
                Dim imgMethod As String = Me.cmbImage.Text
                If dlg.ShowDialog() = DialogResult.OK Then
                    Dim fname As String = dlg.FileName
                    Dim ck1 As Byte = "32"
                    Dim ck2 As Byte = "32"
                    If "Image" = imgMethod Then
                        imagePath = fname
                    ElseIf "BufferedImage" = imgMethod Then
                        result = printer.DefineBufferedImage(fname)
                    ElseIf "NVImage" = imgMethod Then
                        result = printer.DefineNVImage(fname, ck1, ck1)
                    ElseIf "NVImageCompatible" = imgMethod Then
                        result = printer.DefineNVImageCompatible(New String() {fname}, 1)
                    ElseIf "DownloadImage" = imgMethod Then
                        result = printer.DefineDownloadedImage(fname, ck1, ck2)
                    ElseIf "DownloadedImageCompatible" = imgMethod Then
                        result = printer.DefineDownloadedImageCompatible(fname)
                    End If
                End If
                Index = Me.cmbImage.SelectedIndex
                If Constants.E_SUCCESS = result Then
                    MessageBox.Show("DownLoad Succeed.")
                    btnPrint.Enabled = True
                Else
                    MessageBox.Show("DownLoad Failed." + result.ToString())
                    btnPrint.Enabled = False
                End If
            End If
        End Sub
        Private Sub btnPrint_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPrint.Click
            Dim ck1 As Byte = "32"
            Select Case Index
                Case 0
                    printer.PrintImage(imagePath, 0)
                    btnPrint.Enabled = False
                    Exit Select
                Case 1
                    printer.PrintBufferedImage()
                    btnPrint.Enabled = False
                    Exit Select
                Case 2
                    printer.PrintNVImage(ck1, ck1)
                    Exit Select
                Case 3
                    printer.PrintNVImageCompatible(1, 0)
                    Exit Select
                Case 4
                    printer.PrintDownloadedImageCompatible(0)
                    Exit Select
                Case Else
                    Exit Select
            End Select
        End Sub
        Private WithEvents btnWindowsFont As System.Windows.Forms.Button
        Private WithEvents lblModel As System.Windows.Forms.Label
        Private WithEvents tabPage1 As System.Windows.Forms.TabPage
        Private WithEvents btnPrintReceipt As System.Windows.Forms.Button
        Private WithEvents btnPrintLabel As System.Windows.Forms.Button
        Private WithEvents txtPortSetting As System.Windows.Forms.TextBox
        Private WithEvents cmbPortType As System.Windows.Forms.ComboBox
        Private WithEvents cmbImage As System.Windows.Forms.ComboBox
        Private WithEvents cmbModel As System.Windows.Forms.ComboBox
        Private WithEvents btnConnect As System.Windows.Forms.Button
        Private WithEvents tabControl1 As System.Windows.Forms.TabControl
        Private WithEvents tabPage2 As System.Windows.Forms.TabPage
        Private WithEvents btnPrint As System.Windows.Forms.Button
        Private WithEvents btnDownLoadImage As System.Windows.Forms.Button
        Private WithEvents tabPage3 As System.Windows.Forms.TabPage
        Private WithEvents btnRealTimeStatus As System.Windows.Forms.Button
        Private WithEvents btnDirectIO As System.Windows.Forms.Button
        Private WithEvents tabPage4 As System.Windows.Forms.TabPage
        Private WithEvents tabPage5 As System.Windows.Forms.TabPage
        Private WithEvents btnVersion As System.Windows.Forms.Button
        Private WithEvents btnClose As System.Windows.Forms.Button
        Private WithEvents btnStop As System.Windows.Forms.Button
        Private WithEvents grbBtn As System.Windows.Forms.GroupBox
        Private WithEvents tboxInfo As System.Windows.Forms.TextBox
        Private WithEvents grbConfig As System.Windows.Forms.GroupBox
        Private WithEvents labPortName As System.Windows.Forms.Label
        Private WithEvents label1 As System.Windows.Forms.Label

        Private Sub InitializeComponent()
            Me.btnWindowsFont = New System.Windows.Forms.Button()
            Me.lblModel = New System.Windows.Forms.Label()
            Me.tabPage1 = New System.Windows.Forms.TabPage()
            Me.btnPrintReceipt = New System.Windows.Forms.Button()
            Me.btnPrintLabel = New System.Windows.Forms.Button()
            Me.txtPortSetting = New System.Windows.Forms.TextBox()
            Me.cmbPortType = New System.Windows.Forms.ComboBox()
            Me.cmbImage = New System.Windows.Forms.ComboBox()
            Me.cmbModel = New System.Windows.Forms.ComboBox()
            Me.btnConnect = New System.Windows.Forms.Button()
            Me.tabControl1 = New System.Windows.Forms.TabControl()
            Me.tabPage2 = New System.Windows.Forms.TabPage()
            Me.btnPrint = New System.Windows.Forms.Button()
            Me.btnDownLoadImage = New System.Windows.Forms.Button()
            Me.tabPage3 = New System.Windows.Forms.TabPage()
            Me.btnRealTimeStatus = New System.Windows.Forms.Button()
            Me.btnDirectIO = New System.Windows.Forms.Button()
            Me.tabPage4 = New System.Windows.Forms.TabPage()
            Me.tabPage5 = New System.Windows.Forms.TabPage()
            Me.btnVersion = New System.Windows.Forms.Button()
            Me.btnClose = New System.Windows.Forms.Button()
            Me.btnStop = New System.Windows.Forms.Button()
            Me.grbBtn = New System.Windows.Forms.GroupBox()
            Me.tboxInfo = New System.Windows.Forms.TextBox()
            Me.grbConfig = New System.Windows.Forms.GroupBox()
            Me.labPortName = New System.Windows.Forms.Label()
            Me.label1 = New System.Windows.Forms.Label()
            Me.tabPage1.SuspendLayout()
            Me.tabControl1.SuspendLayout()
            Me.tabPage2.SuspendLayout()
            Me.tabPage3.SuspendLayout()
            Me.tabPage4.SuspendLayout()
            Me.tabPage5.SuspendLayout()
            Me.grbBtn.SuspendLayout()
            Me.grbConfig.SuspendLayout()
            Me.SuspendLayout()
            '
            'btnWindowsFont
            '
            Me.btnWindowsFont.Location = New System.Drawing.Point(116, 10)
            Me.btnWindowsFont.Name = "btnWindowsFont"
            Me.btnWindowsFont.Size = New System.Drawing.Size(84, 30)
            Me.btnWindowsFont.TabIndex = 30
            Me.btnWindowsFont.Text = "WindowsFont"
            Me.btnWindowsFont.UseVisualStyleBackColor = True
            '
            'lblModel
            '
            Me.lblModel.AutoSize = True
            Me.lblModel.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
            Me.lblModel.Location = New System.Drawing.Point(8, 21)
            Me.lblModel.Name = "lblModel"
            Me.lblModel.Size = New System.Drawing.Size(49, 14)
            Me.lblModel.TabIndex = 27
            Me.lblModel.Text = "Model:"
            '
            'tabPage1
            '
            Me.tabPage1.Controls.Add(Me.btnPrintReceipt)
            Me.tabPage1.Controls.Add(Me.btnPrintLabel)
            Me.tabPage1.Location = New System.Drawing.Point(4, 22)
            Me.tabPage1.Name = "tabPage1"
            Me.tabPage1.Padding = New System.Windows.Forms.Padding(3)
            Me.tabPage1.Size = New System.Drawing.Size(352, 48)
            Me.tabPage1.TabIndex = 0
            Me.tabPage1.Text = "Print"
            Me.tabPage1.UseVisualStyleBackColor = True
            '
            'btnPrintReceipt
            '
            Me.btnPrintReceipt.Location = New System.Drawing.Point(37, 10)
            Me.btnPrintReceipt.Name = "btnPrintReceipt"
            Me.btnPrintReceipt.Size = New System.Drawing.Size(89, 30)
            Me.btnPrintReceipt.TabIndex = 22
            Me.btnPrintReceipt.Text = "Receipt"
            Me.btnPrintReceipt.UseVisualStyleBackColor = True
            '
            'btnPrintLabel
            '
            Me.btnPrintLabel.Location = New System.Drawing.Point(220, 10)
            Me.btnPrintLabel.Name = "btnPrintLabel"
            Me.btnPrintLabel.Size = New System.Drawing.Size(89, 30)
            Me.btnPrintLabel.TabIndex = 10
            Me.btnPrintLabel.Text = "Label"
            '
            'txtPortSetting
            '
            Me.txtPortSetting.Location = New System.Drawing.Point(241, 18)
            Me.txtPortSetting.Name = "txtPortSetting"
            Me.txtPortSetting.Size = New System.Drawing.Size(130, 21)
            Me.txtPortSetting.TabIndex = 23
            '
            'cmbPortType
            '
            Me.cmbPortType.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
            Me.cmbPortType.Items.AddRange(New Object() {"Net", "USB", "LPT", "COM"})
            Me.cmbPortType.Location = New System.Drawing.Point(173, 18)
            Me.cmbPortType.Name = "cmbPortType"
            Me.cmbPortType.Size = New System.Drawing.Size(62, 20)
            Me.cmbPortType.TabIndex = 6
            '
            'cmbImage
            '
            Me.cmbImage.FormattingEnabled = True
            Me.cmbImage.Items.AddRange(New Object() {"Image", "BufferedImage", "NVImage", "NVImageCompatible", "DownloadedImageCompatible"})
            Me.cmbImage.Location = New System.Drawing.Point(6, 15)
            Me.cmbImage.Name = "cmbImage"
            Me.cmbImage.Size = New System.Drawing.Size(140, 20)
            Me.cmbImage.TabIndex = 33
            '
            'cmbModel
            '
            Me.cmbModel.FormattingEnabled = True
            Me.cmbModel.Items.AddRange(New Object() {"TP801", "TP805", "TP806", "HM-E200", "MLP2"})
            Me.cmbModel.Location = New System.Drawing.Point(53, 18)
            Me.cmbModel.Name = "cmbModel"
            Me.cmbModel.Size = New System.Drawing.Size(80, 20)
            Me.cmbModel.TabIndex = 30
            '
            'btnConnect
            '
            Me.btnConnect.Location = New System.Drawing.Point(227, 65)
            Me.btnConnect.Name = "btnConnect"
            Me.btnConnect.Size = New System.Drawing.Size(75, 30)
            Me.btnConnect.TabIndex = 37
            Me.btnConnect.Text = "Connect"
            '
            'tabControl1
            '
            Me.tabControl1.Controls.Add(Me.tabPage1)
            Me.tabControl1.Controls.Add(Me.tabPage2)
            Me.tabControl1.Controls.Add(Me.tabPage3)
            Me.tabControl1.Controls.Add(Me.tabPage4)
            Me.tabControl1.Controls.Add(Me.tabPage5)
            Me.tabControl1.Location = New System.Drawing.Point(11, 20)
            Me.tabControl1.Name = "tabControl1"
            Me.tabControl1.SelectedIndex = 0
            Me.tabControl1.Size = New System.Drawing.Size(360, 74)
            Me.tabControl1.TabIndex = 30
            '
            'tabPage2
            '
            Me.tabPage2.Controls.Add(Me.btnPrint)
            Me.tabPage2.Controls.Add(Me.btnDownLoadImage)
            Me.tabPage2.Controls.Add(Me.cmbImage)
            Me.tabPage2.Location = New System.Drawing.Point(4, 22)
            Me.tabPage2.Name = "tabPage2"
            Me.tabPage2.Padding = New System.Windows.Forms.Padding(3)
            Me.tabPage2.Size = New System.Drawing.Size(352, 48)
            Me.tabPage2.TabIndex = 1
            Me.tabPage2.Text = "Image"
            Me.tabPage2.UseVisualStyleBackColor = True
            '
            'btnPrint
            '
            Me.btnPrint.Enabled = False
            Me.btnPrint.Location = New System.Drawing.Point(257, 9)
            Me.btnPrint.Name = "btnPrint"
            Me.btnPrint.Size = New System.Drawing.Size(75, 30)
            Me.btnPrint.TabIndex = 35
            Me.btnPrint.Text = "Print"
            Me.btnPrint.UseVisualStyleBackColor = True
            '
            'btnDownLoadImage
            '
            Me.btnDownLoadImage.Location = New System.Drawing.Point(158, 9)
            Me.btnDownLoadImage.Name = "btnDownLoadImage"
            Me.btnDownLoadImage.Size = New System.Drawing.Size(75, 30)
            Me.btnDownLoadImage.TabIndex = 34
            Me.btnDownLoadImage.Text = "Download"
            Me.btnDownLoadImage.UseVisualStyleBackColor = True
            '
            'tabPage3
            '
            Me.tabPage3.Controls.Add(Me.btnRealTimeStatus)
            Me.tabPage3.Controls.Add(Me.btnDirectIO)
            Me.tabPage3.Location = New System.Drawing.Point(4, 22)
            Me.tabPage3.Name = "tabPage3"
            Me.tabPage3.Padding = New System.Windows.Forms.Padding(3)
            Me.tabPage3.Size = New System.Drawing.Size(352, 48)
            Me.tabPage3.TabIndex = 2
            Me.tabPage3.Text = "Status"
            Me.tabPage3.UseVisualStyleBackColor = True
            '
            'btnRealTimeStatus
            '
            Me.btnRealTimeStatus.Location = New System.Drawing.Point(51, 9)
            Me.btnRealTimeStatus.Name = "btnRealTimeStatus"
            Me.btnRealTimeStatus.Size = New System.Drawing.Size(89, 30)
            Me.btnRealTimeStatus.TabIndex = 15
            Me.btnRealTimeStatus.Text = "State"
            '
            'btnDirectIO
            '
            Me.btnDirectIO.Location = New System.Drawing.Point(208, 9)
            Me.btnDirectIO.Name = "btnDirectIO"
            Me.btnDirectIO.Size = New System.Drawing.Size(89, 30)
            Me.btnDirectIO.TabIndex = 24
            Me.btnDirectIO.Text = "Other"
            Me.btnDirectIO.UseVisualStyleBackColor = True
            '
            'tabPage4
            '
            Me.tabPage4.Controls.Add(Me.btnWindowsFont)
            Me.tabPage4.Location = New System.Drawing.Point(4, 22)
            Me.tabPage4.Name = "tabPage4"
            Me.tabPage4.Size = New System.Drawing.Size(352, 48)
            Me.tabPage4.TabIndex = 3
            Me.tabPage4.Text = "WindowsFont"
            Me.tabPage4.UseVisualStyleBackColor = True
            '
            'tabPage5
            '
            Me.tabPage5.Controls.Add(Me.btnVersion)
            Me.tabPage5.Location = New System.Drawing.Point(4, 22)
            Me.tabPage5.Name = "tabPage5"
            Me.tabPage5.Size = New System.Drawing.Size(352, 48)
            Me.tabPage5.TabIndex = 4
            Me.tabPage5.Text = "Version"
            Me.tabPage5.UseVisualStyleBackColor = True
            '
            'btnVersion
            '
            Me.btnVersion.Location = New System.Drawing.Point(116, 9)
            Me.btnVersion.Name = "btnVersion"
            Me.btnVersion.Size = New System.Drawing.Size(84, 30)
            Me.btnVersion.TabIndex = 31
            Me.btnVersion.Text = "Version"
            Me.btnVersion.UseVisualStyleBackColor = True
            '
            'btnClose
            '
            Me.btnClose.Location = New System.Drawing.Point(308, 272)
            Me.btnClose.Name = "btnClose"
            Me.btnClose.Size = New System.Drawing.Size(75, 30)
            Me.btnClose.TabIndex = 38
            Me.btnClose.Text = "Close"
            '
            'btnStop
            '
            Me.btnStop.Location = New System.Drawing.Point(308, 65)
            Me.btnStop.Name = "btnStop"
            Me.btnStop.Size = New System.Drawing.Size(75, 30)
            Me.btnStop.TabIndex = 39
            Me.btnStop.Text = "Stop"
            '
            'grbBtn
            '
            Me.grbBtn.Controls.Add(Me.tabControl1)
            Me.grbBtn.Location = New System.Drawing.Point(12, 95)
            Me.grbBtn.Name = "grbBtn"
            Me.grbBtn.Size = New System.Drawing.Size(382, 100)
            Me.grbBtn.TabIndex = 41
            Me.grbBtn.TabStop = False
            Me.grbBtn.Text = "Functions"
            '
            'tboxInfo
            '
            Me.tboxInfo.ForeColor = System.Drawing.SystemColors.Highlight
            Me.tboxInfo.Location = New System.Drawing.Point(12, 216)
            Me.tboxInfo.Multiline = True
            Me.tboxInfo.Name = "tboxInfo"
            Me.tboxInfo.ReadOnly = True
            Me.tboxInfo.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
            Me.tboxInfo.Size = New System.Drawing.Size(382, 51)
            Me.tboxInfo.TabIndex = 40
            '
            'grbConfig
            '
            Me.grbConfig.Controls.Add(Me.cmbModel)
            Me.grbConfig.Controls.Add(Me.lblModel)
            Me.grbConfig.Controls.Add(Me.txtPortSetting)
            Me.grbConfig.Controls.Add(Me.cmbPortType)
            Me.grbConfig.Controls.Add(Me.labPortName)
            Me.grbConfig.Location = New System.Drawing.Point(12, 12)
            Me.grbConfig.Name = "grbConfig"
            Me.grbConfig.Size = New System.Drawing.Size(382, 47)
            Me.grbConfig.TabIndex = 42
            Me.grbConfig.TabStop = False
            '
            'labPortName
            '
            Me.labPortName.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
            Me.labPortName.Location = New System.Drawing.Point(135, 21)
            Me.labPortName.Name = "labPortName"
            Me.labPortName.Size = New System.Drawing.Size(56, 20)
            Me.labPortName.TabIndex = 13
            Me.labPortName.Text = "Port:"
            '
            'label1
            '
            Me.label1.AutoSize = True
            Me.label1.ForeColor = System.Drawing.Color.DodgerBlue
            Me.label1.Location = New System.Drawing.Point(12, 198)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(77, 12)
            Me.label1.TabIndex = 43
            Me.label1.Text = "Information:"
            '
            'PrtWinDemoForm
            '
            Me.ClientSize = New System.Drawing.Size(409, 322)
            Me.Controls.Add(Me.btnConnect)
            Me.Controls.Add(Me.btnClose)
            Me.Controls.Add(Me.btnStop)
            Me.Controls.Add(Me.grbBtn)
            Me.Controls.Add(Me.tboxInfo)
            Me.Controls.Add(Me.grbConfig)
            Me.Controls.Add(Me.label1)
            Me.Name = "PrtWinDemoForm"
            Me.tabPage1.ResumeLayout(False)
            Me.tabControl1.ResumeLayout(False)
            Me.tabPage2.ResumeLayout(False)
            Me.tabPage3.ResumeLayout(False)
            Me.tabPage4.ResumeLayout(False)
            Me.tabPage5.ResumeLayout(False)
            Me.grbBtn.ResumeLayout(False)
            Me.grbConfig.ResumeLayout(False)
            Me.grbConfig.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub

        Private Sub btnDirectIO_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)

        End Sub

        Private Sub btnClose_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)

        End Sub
    End Class
End Namespace
