Dim111 Dim111 - 14 days ago 5
C# Question

Any click after clicking my richTextBox changing the size back to normal

when i'm clicking in my richTextBox i running this code for making my textbox bigger for user:

this.richTextBox1.Size = new System.Drawing.Size(500, 100);


Now i want any click after clicking my richTextBox to change the size back to normal example:

this.richTextBox1.Size = new System.Drawing.Size(477, 26);


I can use the code above for each element mouse click event, i just wonder if i cant do this with easiest way

Answer

Just write the first code in richtextbox.enter event. And the second in richtextbox.leave event. Otherwise MouseClick is not a bad idea