Exemplo n.º 1
0
 private void ChatTextBox_TextChanged(object sender, EventArgs e)
 {
     ChatTextBox.Focus();
     ChatTextBox.Select(ChatTextBox.TextLength, 0);
     ChatTextBox.ScrollToCaret();
     MsgToSend.Focus();
 }
Exemplo n.º 2
0
        //private void CheckEnter(object sender, KeyPressEventArgs e)
        //{
        //    if (e.KeyChar == (char)13)
        //    {
        //        ChatSendButton_Click(sender, e);
        //    }
        //    //ChatTextBox.Text = ChatTextBox.Text.TrimEnd(); профіксить перекид
        //    //ChatTextBox.Text = string.Empty;
        //}

        private void ChatSendButton_Click(object sender, EventArgs e)
        {
            //InitializeSender();

            ChatTextBox.Text = ChatTextBox.Text.TrimEnd();
            var userName = MainWindow.Passtext;

            if (!string.IsNullOrEmpty(ChatTextBox.Text))
            {
                var toSend  = userName + ":" + Environment.NewLine + ChatTextBox.Text;
                var yousend = "You" + ":" + Environment.NewLine + ChatTextBox.Text;
                var data    = Encoding.UTF8.GetBytes(toSend);
                _udpClient.Send(data, data.Length);
                ChatTextBox.Text = "";

                Receiver_TextBox.Text += yousend + Environment.NewLine;
            }
            ChatTextBox.Focus();
        }
Exemplo n.º 3
0
 private void LayoutRoot_OnDoubleTap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     ChatPopup.IsOpen = true;
     ChatTextBox.Focus();
 }
Exemplo n.º 4
0
 private void ImageCanvas_OnDoubleTap(object sender, GestureEventArgs e)
 {
     ChatPopup.IsOpen = true;
     ChatTextBox.Focus();
 }