I have text boxes that are small, but when clicked they will resize to large. The button is created and then I need the button to resize them back to where they were but I cannot reference the button anywhere except where I declared it.
ooo.Dispose() does not compile because of that, Help.
ooo.Dispose() does not compile because of that, Help.
Code:
private void richTextBox1_Enter(object sender, System.EventArgs e)
{
this.richTextBox1.BringToFront();
this.richTextBox1.Size = new System.Drawing.Size(496, 300);
Control r=new Button();
r.Font = new System.Drawing.Font("Verdana", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
r.Location = new System.Drawing.Point(richTextBox1.Location.X-35, richTextBox1.Location.Y);
r.Name = "ooo";
r.Size = new System.Drawing.Size(35, 20);
r.TabIndex = 1;
r.Text = "Exit";
Controls.Add(r);
r.BringToFront();
r.Show();
}
private void ooo_Click(object sender, System.EventArgs e)
{
this.richTextBox1.Size = new System.Drawing.Size(496, 48);
ooo.Dispose();
}