Dim111
Dim111

Reputation: 49

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

When I click in my richTextBox, I run this code to make my textbox bigger for the 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 the original:

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

I can use the code above for each element mouse click event, but I am wondering if there is an easier way.

Upvotes: 1

Views: 58

Answers (1)

Hadi
Hadi

Reputation: 37358

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

Upvotes: 1

Related Questions