private void GetKey(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { ChatTb.Focus(); } }
private void PushMessage(string Content, string FromName) { Content = Content.Replace("<br />", "\r\n"); //convert from HTML to Textbox's text CreateMessage(Content, FromName); ChatTb.Text = ""; ChatTb.Focus(); }
private void GameInit() { PlayPanel.Children.Clear(); CreatePlayGround(); ChatTb.Focus(); MyName = NameTb.Text; if (Board.CurrentMode == PlayMode.Online || Board.CurrentMode == PlayMode.MachineVsOnline) { GomokuSocket = IO.Socket(WebConfigurationManager.AppSettings.Get("ServerAddress")); InitConnect(); //Initialize Connect ChatConnect(); //Create Thread for chatting GamePlayConnect(); //Create Threads for playing } }
private void NameChanged_Click(object sender, RoutedEventArgs e) { if (!isConnectedToPeople && Connected) { GomokuSocket.Emit("ConnectToOtherPlayer"); ((Button)sender).Content = "Change!"; isConnectedToPeople = true; } else { ChatTb.Focus(); } MyName = NameTb.Text; GomokuSocket.Emit("MyNameIs", MyName); }