I can't figure out the intention of that code fragment but it doesn't look right. Can you explain the use of the do while loop and the variable myComPortName?
I would have just used this (assuming cboPort is a combobox)
private void button4_Click(object sender, EventArgs e)
{
cboPort.DataSource = SerialPort.GetPortNames();
}
Alan.