Home General VB.NET Add available COM ports to list
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

Add available COM ports to list PDF Print E-mail
User Rating: / 2
PoorBest 
Tutorials

The Function below adds all available COM ports to a combobox. 

    1 Imports System

    2 Imports System.IO.Ports

    3 Imports System.Threading

    4 

    5 

    6 Function AddCom2Combo(ByVal cbPort As ComboBox)

    7 

    8     ' Get a list of serial port names.

    9     Dim ports As String() = SerialPort.GetPortNames()

   10     ' Show a label with Action information on it

   11     cbPort.Text = "The following serial ports were found:"

   12 

   13     ' Put each port name Into a comboBox control.

   14     Dim port As String

   15     For Each port In ports

   16         cbPort.Items.Add(port)

   17 

   18     Next port

   19     ' Select the first item in the combo control

   20     cbPort.SelectedIndex = 0

   21 End Function


 

 

Comments   

 
0 #1 Guest 2011-06-15 15:21
do you have code for vb6 desame functions
Quote
 

Add comment


Security code
Refresh

This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade