0

I have a multi-form project in vb.net. A few of the forms use serial port communication, and I open the serial port on the form_load event on each form. Part of opening the serial port is specifying baudrate, port name, etc.

I might have the use this project on a few computers, so I want to make a string that contains the com port (i.e. "COM3") that I can use when opening the COM port. This way, when I deploy on a different computer, all I have to do is edit the one string variable. How would I define the string so that it can be used on every form the in the project, and how would I call that string on each form? Also, where would I define it? On the first form that loads?

  • 1
    You could created a `Variables.vb` file and define everything you need in there? If you make it a module it should be easy to refer to it over your project – Sasha Feb 23 '18 at 14:11
  • Have you look into using the config file? – the_lotus Feb 23 '18 at 14:11

0 Answers0