How to open Second Window

Hi everyone, I’m working with my program and serial. I connect a device close to the PC COM and I can send it commands via Serial. My screen provides for the insertion of commands on a TextArea and the SEND button on the side to send the command on serial. My question is this:

When I click SEND can I open another window and add them commands and send them on the serial? I would not want to choose the COM because I already connected it the first time. How can I do?

Thanks

You create the second window at design time in the IDE.

Create a new Window and name it wCommandHistory
Populate it with the controls that you need
Add code to the Open Event to take the command that was sent and add it to an array
Move your serial port write and read calls as methods (CallBacks) on the wCommandHistory window
In the main window’s “SEND” button, Call “wCommandHistory.Show”
In the wCommandHistory Open event, send your serial command and receive the result