C# 井字遊戲
開始畫面。 遊戲畫面。 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace CSharp_井字遊戲 { public partial class Form1 : Form { public Form1() { InitializeComponent(); Symbol1_tb.TextChanged += SymbolTextChenge; Symbol2_tb.TextChanged += SymbolTextChenge; Symbol1_tb.MouseClick += Symbol_tb_MouseClick; Symbol2_tb.MouseClick += Symbol_tb_MouseClick; } private void Symbol_tb_MouseClick(object sender, MouseEventArgs e) { TextBox tb = sender as TextBox; tb.SelectAll(); } private void SymbolTextChenge(object sender, EventArgs e) { TextBox tb = sender as TextBox; if (tb.TextLength >= 2) { tb.SelectAll();