コード例 #1
0
 private void buttonC_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("\tAtentie !\nToate datele nesalvate vor fi sterse.", "Conectare", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         richTextBoxText.ResetText();
         String sIP = "127.0.0.1";
         sIP = InputBoxDialog.InputBox("\tIP Server", "IP", "127.0.0.1");
         c   = new Client(this.richTextBoxText, sIP);
         Thread t = new Thread(new ThreadStart(c.StartClient));
         t.Start();
         connect(false);
     }
 }
コード例 #2
0
        public static string InputBox(string prompt,
                                      string title, string defaultValue)
        {
            InputBoxDialog ib = new InputBoxDialog();

            ib.FormPrompt   = prompt;
            ib.FormCaption  = title;
            ib.DefaultValue = defaultValue;
            ib.ShowDialog();
            string s = ib.InputResponse;

            ib.Close();
            return(s);
        }