Option Strict Off
Option Explicit On



Imports System.Runtime.InteropServices
Imports System.IO
Imports System.Text
Imports System.Diagnostics


Friend Class Form1
	Inherits System.Windows.Forms.Form
	'/*******************************************************************/
	'/*                                                                 */
	'/* Application:   UsbHidDemoVB                                     */
	'/*                                                                 */
	'/* Author:        K. Delahoussaye                                  */
	'/*                kdelahou@worldnet.att.net                        */
	'/*                http://www.kadtronix.com/usbhidapi.htm           */
	'/*                                                                 */
	'/* Description:                                                    */
	'/*                                                                 */
	'/*    This application demonstrates how to use and apply the       */
	'/*    the USB HID API library (UsbHidApi.DLL) for accessing        */
	'/*    a USB HID device.                                            */
	'/*                                                                 */
	'/* Disclaimer:                                                     */
	'/*                                                                 */
	'/*    This software may be freely distributed and used by anyone   */
	'/*    for non-commercial use.  There are no warranties associated  */
	'/*    with this software, either expressly or implied.  The author */
	'/*    assumes no liability for any damage or injury as a result of */
	'/*    information contained within this application or its use.    */
	'/*                                                                 */
	'/* Revision History:                                               */
	'/*                                                                 */
	'/*    Name   Ver   Date      Description                           */
	'/*    ----   ---   ----      -----------                           */
	'/*    KAD    1.0   03/12/05  Initial version                       */
	'/*    KAD    1.1   07/05/05  Increased send_buf[] & recv_buf[].    */
	'/*    KAD    1.2   03/12/07  Corrected bug which resulted in       */
	'/*                            incorrect device selection when      */
	'/*                            there are multiple interfaces and/or */
	'/*                            collections.                         */
	'/*                                                                 */
	'/*******************************************************************/
	
	' This structure defines an entry in a device list
	' The list describes the parameters associated with
	' a device.  It is mainly used with the GetList()
	' function.
	Private Structure mdeviceList
		Dim DeviceName As Integer ' Device name
		Dim Manufacturer As Integer ' Manufacturer
		Dim SerialNumber As Integer ' Serial number
		Dim VendorID As Integer ' Vendor ID
		Dim ProductID As Integer ' Product ID
		Dim InputReportLen As Integer ' Length of HID input report (bytes)
		Dim OutputReportLen As Integer ' Length of HID output report (bytes)
		'UPGRADE_NOTE: Interface was upgraded to Interface_Renamed. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
		Dim Interface_Renamed As Integer ' Interface (added 3/12/07)
		Dim Collection As Integer ' Collection (added 3/12/07)
	End Structure
	
	' This constant defines the maximum number of USB devices we will
	' attempt to retreive using the GetList() function.
	Private Const MAX_DEVICES As Short = 10
	
	'UPGRADE_NOTE: val was upgraded to val_Renamed. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
	Private Declare Function SetInstance Lib "UsbHidApi" (ByVal val_Renamed As Integer) As Integer
	Private Declare Function GetLibVersion Lib "UsbHidApi.dll" (ByVal pBuf As String) As Integer
	Private Declare Sub CloseWrite Lib "UsbHidApi.dll" ()
	Private Declare Sub CloseRead Lib "UsbHidApi.dll" ()
	Private Declare Function Read Lib "UsbHidApi.dll" (ByRef pBuf As Byte) As Integer
	Private Declare Function Write2 Lib "UsbHidApi.dll"  Alias "Write"(ByRef pBuf As Byte) As Integer
	Private Declare Sub ShowVersion Lib "UsbHidApi.dll" ()
	Private Declare Sub GetReportLengths Lib "UsbHidApi.dll" (ByRef inlen As Integer, ByRef outlen As Integer)
	Private Declare Function Open2 Lib "UsbHidApi.dll"  Alias "Open"(ByVal VendorID As Integer, ByVal ProductID As Integer, ByVal Manufacturer As String, ByVal SerialNumber As String, ByVal DeviceName As String, ByVal bAsync As Integer) As Integer
	'UPGRADE_WARNING: Structure mdeviceList may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
	Private Declare Function GetList Lib "UsbHidApi.dll" (ByVal VendorID As Integer, ByVal ProductID As Integer, ByVal Manufacturer As String, ByVal SerialNumber As String, ByVal DeviceName As String, ByRef DeviceList As mdeviceList, ByVal MaxDevices As Integer) As Integer
	Private Declare Sub SetCollection Lib "UsbHidApi.dll" (ByVal col As Object)
	Private Declare Function GetCollection Lib "UsbHidApi.dll" () As Integer
	Private Declare Sub SetInterface Lib "UsbHidApi.dll" (ByVal iface As Object)
	Private Declare Function GetInterface Lib "UsbHidApi.dll" () As Integer
	
	Dim StrDeviceName(MAX_DEVICES) As String
	Dim StrManufacturer(MAX_DEVICES) As String
	Dim StrSerialNumber(MAX_DEVICES) As String
	Dim StrVendorID(MAX_DEVICES) As String
	Dim StrProductID(MAX_DEVICES) As String
	Dim StrInReportLen(MAX_DEVICES) As String
	Dim StrOutReportLen(MAX_DEVICES) As String
	Dim Interfaces(MAX_DEVICES) As Integer
	Dim Collections(MAX_DEVICES) As Integer
	
	Public VendorID As Integer
	Public ProductID As Integer
	Public Manufacturer As String
	Public SerialNumber As String
	Public DeviceName As String
	Public InputReportLen As Integer
	Public OutputReportLen As Integer
	Public bAsync As Integer
	
	
	Private Sub Command1_Click()
		Dim Device As System.Windows.Forms.ListViewItem
		Dim nDevices As Short
		Dim dev As Short
		
		' Disable the "Open" button
		OpenDev(0).Enabled = False
		
		' Clear the listview contents
		DeviceList.Items.Clear()
		
		' Retrieve list of USB HID devices
		nDevices = GetDevices()
		
		
		' Display the retreived device(s)
		If (nDevices > 0) Then
			For dev = 0 To (nDevices - 1)
				
				' Populate the listview control
				'UPGRADE_ISSUE: MSComctlLib.ListItems method DeviceList.ListItems.Add was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
                Device = DeviceList.Items.Add("hello")
				Device.Text = StrDeviceName(dev)
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 1 Then
					Device.SubItems(1).Text = StrManufacturer(dev)
				Else
					Device.SubItems.Insert(1, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrManufacturer(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 2 Then
					Device.SubItems(2).Text = StrVendorID(dev)
				Else
					Device.SubItems.Insert(2, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrVendorID(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 3 Then
					Device.SubItems(3).Text = StrProductID(dev)
				Else
					Device.SubItems.Insert(3, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrProductID(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 4 Then
					Device.SubItems(4).Text = StrSerialNumber(dev)
				Else
					Device.SubItems.Insert(4, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrSerialNumber(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 5 Then
					Device.SubItems(5).Text = StrInReportLen(dev)
				Else
					Device.SubItems.Insert(5, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrInReportLen(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 6 Then
					Device.SubItems(6).Text = StrOutReportLen(dev)
				Else
					Device.SubItems.Insert(6, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrOutReportLen(dev)))
				End If
			Next 
		End If
		
	End Sub
	
	' This is somewhat like the 'InitDialog()' function
	' in Visual C++
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		
		' Populate the device list
		MyRefreshCmd_Click(MyRefreshCmd, New System.EventArgs())
		'Call MsgBox("Test")
		
	End Sub
	
	
	Sub MyRefreshCmd_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyRefreshCmd.Click
		
		Dim Device As System.Windows.Forms.ListViewItem
		Dim nDevices As Short
		Dim dev As Short
		
		' Disable the "Open" button
		OpenDev(0).Enabled = False
		
		' Clear the listview contents
		DeviceList.Items.Clear()
		
		' Retrieve list of USB HID devices
		nDevices = GetDevices()
		
		
		' Display the retreived device(s)
		If (nDevices > 0) Then
			For dev = 0 To (nDevices - 1)
				
				' Populate the listview control
				'UPGRADE_ISSUE: MSComctlLib.ListItems method DeviceList.ListItems.Add was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
                Device = DeviceList.Items.Add("hello")
				Device.Text = StrDeviceName(dev)
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 1 Then
					Device.SubItems(1).Text = StrManufacturer(dev)
				Else
					Device.SubItems.Insert(1, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrManufacturer(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 2 Then
					Device.SubItems(2).Text = StrVendorID(dev)
				Else
					Device.SubItems.Insert(2, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrVendorID(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 3 Then
					Device.SubItems(3).Text = StrProductID(dev)
				Else
					Device.SubItems.Insert(3, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrProductID(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 4 Then
					Device.SubItems(4).Text = StrSerialNumber(dev)
				Else
					Device.SubItems.Insert(4, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrSerialNumber(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 5 Then
					Device.SubItems(5).Text = StrInReportLen(dev)
				Else
					Device.SubItems.Insert(5, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrInReportLen(dev)))
				End If
				'UPGRADE_WARNING: Lower bound of collection Device has changed from 1 to 0. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				If Device.SubItems.Count > 6 Then
					Device.SubItems(6).Text = StrOutReportLen(dev)
				Else
					Device.SubItems.Insert(6, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, StrOutReportLen(dev)))
				End If
			Next 
		End If
		
	End Sub
	
	Private Sub OpenDev_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles OpenDev.Click
		Dim Index As Short = OpenDev.GetIndex(eventSender)
		
		' Get the listview index representing the user's selection
		Dim idx As Short
		
		idx = DeviceList.FocusedItem.Index
        'steve idx = idx - 1 ' The index is 1-based; change to 0-based
		
		' Validate the index
		If (idx < 0) Then
			Call MsgBox("Invalid device index " & idx)
		Else
			
			' Store interface and collection
			' added 3/12/07
			Dialog1.Interface_Renamed = Interfaces(idx)
			Dialog1.Collection = Collections(idx)
			
			' Assign variables based on the user-selected device
			Dialog1.VendorID = Val(StrVendorID(idx))
			Dialog1.ProductID = Val(StrProductID(idx))
			Dialog1.SerialNumber = StrSerialNumber(idx)
			Dialog1.Manufacturer = StrManufacturer(idx)
			Dialog1.DeviceName = StrDeviceName(idx)
			Dialog1.OutputReportLen = Val(StrOutReportLen(idx))
			Dialog1.InputReportLen = Val(StrInReportLen(idx))
			
			' Display the dialog box
			Dialog1.ShowDialog()
			
			' Ensure that our list selection is still highlighted
			DeviceList.Focus()
			
		End If
		
	End Sub
	
	
	Private Sub Cancel_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cancel.Click
		Dim Index As Short = Cancel.GetIndex(eventSender)
		
		' Terminate the program
		End
		
	End Sub
	
	
	
	Private Sub DeviceList_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles DeviceList.Click
		
		' User has made a device selection;  Enable
		' the "Open" button
        OpenDev(0).Enabled = True
		
	End Sub
	
	
	
	
	Private Function GetDevices() As Short
		
        Dim dcnt As Short
        Dim i As Short

        Dim buf As New VB6.FixedLengthString(20) ' Without the specifier, the string len will be 0!
        'UPGRADE_NOTE: val was upgraded to val_Renamed. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
        Dim val_Renamed As Integer

        Dim inlen As Integer
        Dim outlen As Integer

        ' Get list of available USB devices.  (This call will only
        ' retrieve HID-class devices.)
        Dim Devices(MAX_DEVICES) As mdeviceList

        Dim builderD(MAX_DEVICES) As StringBuilder
        Dim builderM(MAX_DEVICES) As StringBuilder
        Dim builderS(MAX_DEVICES) As StringBuilder


        Dim onedevicename As New String(" ", 50) 'String = "                                                  "
        Dim onemanufacturer As New String(" ", 50) 'String = "                                                  "
        Dim oneserialnumber As New String(" ", 50) 'String = "                                                  "



        For i = 0 To MAX_DEVICES

            builderM(i) = New StringBuilder
            builderD(i) = New StringBuilder
            builderS(i) = New StringBuilder


            builderM(i).Length = 0
            builderD(i).Length = 0
            builderS(i).Length = 0
            builderM(i).Append(onemanufacturer)
            builderD(i).Append(onedevicename)
            builderS(i).Append(oneserialnumber)

        Next







        ' Get and display the DLL version
        'Val = GetLibVersion(buf)
        'Call MsgBox("GetLibVersion:  " & buf)

        ' Alternative version display
        'ShowVersion

        ' Set the object instance
        ' (This is optional since '0' is the default.)
        val_Renamed = SetInstance(0)

        'DeviceName = String(0, 0)   ' NULL => Any device
        'SerialNumber = String(0, 0) ' NULL => Any serial number
        'Manufacturer = String(0, 0) ' NULL => Any manufacturer
        VendorID = 65535 ' 0xffff => Any vendor ID
        ProductID = 65535 ' 0xffff => Any product ID

        ' Prepare for the ensuing call to retrieve devices
        Dim cnt As Short
        For cnt = 0 To MAX_DEVICES

            ' Allocate space to each string.
            '(I'm sure there's a better way to do this.)
            StrDeviceName(cnt) = "                                                  "
            StrManufacturer(cnt) = "                                                  "
            StrSerialNumber(cnt) = "                                                  "

            ' Convert from Unicode to ANSI
            'UPGRADE_ISSUE: Constant vbFromUnicode was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="55B59875-9A95-4B71-9D6A-7C294BF7139D"'
            'StrDeviceName(cnt) = StrConv(StrDeviceName(cnt), vbFromUnicode)
            'UPGRADE_ISSUE: Constant vbFromUnicode was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="55B59875-9A95-4B71-9D6A-7C294BF7139D"'
            'StrManufacturer(cnt) = StrConv(StrManufacturer(cnt), vbFromUnicode)
            'UPGRADE_ISSUE: Constant vbFromUnicode was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="55B59875-9A95-4B71-9D6A-7C294BF7139D"'
            'StrSerialNumber(cnt) = StrConv(StrSerialNumber(cnt), vbFromUnicode)

            ' Assign string addresses to structure fields
            'UPGRADE_ISSUE: StrPtr function is not supported. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="367764E5-F3F8-4E43-AC3E-7FE0B5E074E2"'
            Devices(cnt).DeviceName = MyStrPtr(builderD(cnt).ToString)
            'UPGRADE_ISSUE: StrPtr function is not supported. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="367764E5-F3F8-4E43-AC3E-7FE0B5E074E2"'
            Devices(cnt).Manufacturer = MyStrPtr(builderM(cnt).ToString)
            'UPGRADE_ISSUE: StrPtr function is not supported. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="367764E5-F3F8-4E43-AC3E-7FE0B5E074E2"'
            Devices(cnt).SerialNumber = MyStrPtr(builderS(cnt).ToString)

        Next

        '
        ' Call the DLL GetList() routine to get a list of available
        ' USB HID devices.
        '
        dcnt = GetList(VendorID, ProductID, Manufacturer, SerialNumber, DeviceName, Devices(0), MAX_DEVICES)
        'Call MsgBox("GetList returned " & Val)
        If (dcnt <= 0) Then
            Call MsgBox("No USB HID devices found - terminating!")
            End
        End If

        ' Process the list of device(s) we found
        For cnt = 0 To (dcnt - 1)

            ' String fields must be converted back to Unicode
            'UPGRADE_ISSUE: Constant vbUnicode was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="55B59875-9A95-4B71-9D6A-7C294BF7139D"'
            'StrDeviceName(cnt) = StrConv(StrDeviceName(cnt), vbUnicode)
            oneserialnumber = Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(builderS(cnt).ToString))
            onemanufacturer = Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(builderM(cnt).ToString))
            onedevicename = Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(builderD(cnt).ToString))

            StrDeviceName(cnt) = onedevicename
            StrManufacturer(cnt) = onemanufacturer
            StrSerialNumber(cnt) = oneserialnumber
            'UPGRADE_ISSUE: Constant vbUnicode was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="55B59875-9A95-4B71-9D6A-7C294BF7139D"'
            'StrManufacturer(cnt) = StrConv(StrManufacturer(cnt), vbUnicode)
            'UPGRADE_ISSUE: Constant vbUnicode was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="55B59875-9A95-4B71-9D6A-7C294BF7139D"'
            'StrSerialNumber(cnt) = StrConv(StrSerialNumber(cnt), vbUnicode)
            StrVendorID(cnt) = Str(Devices(cnt).VendorID)
            StrProductID(cnt) = Str(Devices(cnt).ProductID)
            StrInReportLen(cnt) = Str(Devices(cnt).InputReportLen)
            StrOutReportLen(cnt) = Str(Devices(cnt).OutputReportLen)

            ' Store interface(s) and/or collection(s)
            ' added 3/12/07
            Interfaces(cnt) = Devices(cnt).Interface_Renamed
            Collections(cnt) = Devices(cnt).Collection

        Next

        ' Return the number of devices we found
        GetDevices = dcnt

    End Function


    Private Function MyStrPtr(ByVal obj As Object) As Integer
        Dim Handle As GCHandle = _
           GCHandle.Alloc(obj, GCHandleType.Pinned)
        Dim intReturn As Integer = _
           Handle.AddrOfPinnedObject.ToInt32
        Handle.Free()
        Return intReturn
    End Function

    Private Sub DeviceList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeviceList.SelectedIndexChanged

    End Sub
End Class