It seems like everything works as I would expect, are you sure you understand the concept of partial classes right?
As soon as you do new Device_Options().Show()
, Device_Options
will create a new and different instance of Devices
, which will of course have selectedDevice
set to the null-string!
E.g. pass your Devices
instance to Device_Options
's constructor:
public partial class Device_Options : Form
{
readonly Devices devices;
public string deviceSettings;
public Device_Options(Devices host)
{
InitializeComponent();
this.devices = host;
deviceLabel.Text = devices.selectedDevice;
}
and then call
new Device_Options(this).Show();