private void buttonConnect_Click(object sender, EventArgs e) { // similar to Form_Load FormCreate frm = new FormCreate(); frm.ShowDialog(); host = frm.host; port = frm.port; ConnectToServer(); }
private void Form1_Load(object sender, EventArgs e) { // entering server's address and port // if you press 'Cancel' button, will be recorded default address and port from const FormCreate frm = new FormCreate(); frm.ShowDialog(); host = frm.host; port = frm.port; ConnectToServer(); }