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 demo26052026 { public partial class UserControl2 : UserControl { Form form { get; set; } public UserControl2(Form s) { form = s; InitializeComponent(); foreach (Control control in this.Controls) { control.Click += textBox5_Click; } } private void textBox5_TextChanged(object sender, EventArgs e) { } private void textBox5_Click(object sender, EventArgs e) { form.Hide(); Form4 form2 = new Form4(int.Parse(this.Name)); form2.ShowDialog(); } } }