private void SendWindow_PreviewDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetData(DataFormats.FileDrop) != null)
     {
         e.Handled = true;
         string       filename     = ((Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
         StreamReader streamReader = new StreamReader(filename);
         SendBox.AppendText(streamReader.ReadToEnd());
     }
 }
Beispiel #2
0
        private void SendBtn_Click(object sender, EventArgs e)
        {
            string message = this.SendBox.Text;

            SendBox.AppendText("work");
            SendBox.Clear();

            Label labmsg = new Label();

            labmsg.AutoSize = true;
            labmsg.Text     = user + ": " + message;
            MessageBox.Show(labmsg.Text);
            DisplayPanel.Controls.Add(labmsg);
            DisplayPanel.ScrollControlIntoView(labmsg);
        }