private void ban_co_MouseDown(object sender, MouseButtonEventArgs e)
        {
            //if (Check == true)
            //{
            //    MessageBox.Show("Máy đang đánh!");
            //    return;
            //}
            Point p = e.GetPosition((IInputElement)sender);

            Row = ((int)p.Y / (int)(ban_co.ActualHeight / 12));
            Col = ((int)p.X / (int)(ban_co.ActualHeight / 12));
            //string kq = "(X, Y) = " + "(" + Row.ToString() + "," + Col.ToString() + ")";
            //if(caro[Row,Col] == 0)
            //{
            //    MessageBox.Show(kq, "Thông báo", MessageBoxButton.OK);
            //    check = false;
            //}
            //else
            //{
            //    MessageBox.Show("Vị trí này đã được đánh");
            //    check = true;
            //    return;
            //}
            check = _check(Row, Col);

            if (type == 1)
            {
                SetTurn(Row, Col);
                if (check == true)
                {
                    turn++;
                    return;
                }
                else
                {
                    if (caro[Row, Col] == 1)
                    {
                        drawEllipse(Row, Col, Brushes.Red);
                    }
                    else if (caro[Row, Col] == 2)
                    {
                        drawEllipse(Row, Col, Brushes.Blue);
                    }
                    Result(Row, Col);
                }
            }
            else if (type == 2)
            {
                if (check == false)
                {
                    if (Check == false)
                    {
                        caro[Row, Col] = 1;
                        drawEllipse(Row, Col, Brushes.Red);
                        Result(Row, Col);
                        Check = true;
                        worker.RunWorkerAsync();
                    }
                    else
                    {
                        MessageBox.Show("Chưa đến lượt của bạn!");
                    }
                }
            }
            else if (type == 3)
            {
                Connect.GuiToaDo(socket, Row, Col);
            }
        }
 private void btn_send_Click(object sender, RoutedEventArgs e)
 {
     Connect.GoiTinNhan(socket, txt_type.Text, name);
     txt_type.Text = "";
 }
 private void btn_change_Click(object sender, RoutedEventArgs e)
 {
     Connect.DoiTen(socket, txt_name.Text);
 }