private void Form1_Load(object sender, EventArgs e) { textBox1.SelectAll(); }
private void textBox1_Enter(object sender, EventArgs e) { textBox1.SelectAll(); }
private void button1_Click(object sender, EventArgs e) { textBox1.SelectAll(); }In this example, the SelectAll method is called when a button named "button1" is clicked, which selects all the text in the text box named "textBox1". The System.Windows.Forms namespace is part of the .NET Framework, so the package library would be the .NET Framework.