private void ChatTextBox_TextChanged(object sender, EventArgs e) { ChatTextBox.Focus(); ChatTextBox.Select(ChatTextBox.TextLength, 0); ChatTextBox.ScrollToCaret(); MsgToSend.Focus(); }
//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(); }
private void LayoutRoot_OnDoubleTap(object sender, Microsoft.Phone.Controls.GestureEventArgs e) { ChatPopup.IsOpen = true; ChatTextBox.Focus(); }
private void ImageCanvas_OnDoubleTap(object sender, GestureEventArgs e) { ChatPopup.IsOpen = true; ChatTextBox.Focus(); }