Closing Serial Port

Hi, I am a reasonably experienced developer but am relatively new to Xojo (2 Months) having moved the VB6.

I am developing a major application which outputs through a serial port.

My connection code works fine:-

serialticker.SerialPort = System.SerialPort("COM1") if then strConnected = "Connected (" + ")" else strConnected = "Not Connected" end if

and the data is sent correctly.

My issue is that the command:-


does not close the port.

Any assistance would be much appreciated.

Many Thanks.