Click here to Skip to main content
15,900,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

Could any body know how to increase the height of Maskedtextbox through code window?

i have tried by increasing the height in DesignSource as well as in code.but MaskedTextbox height remains unchange.

Regards,
Pawan.


UPDATE from OP:
Common Function For MaskedTextbox,Textbox

C#
private void ControlHeightWidth()
         {
               foreach (Control c in this.Controls)
               {
                     if ((c.GetType() == typeof(MaskedTextBox)))
                     {
                           ((MaskedTextBox)c).AutoSize = false;
                           c.Size = new Size(130, 30);
                     }
                     if ((c.GetType() == typeof(TextBox)))
                     {
                           ((TextBox)c).AutoSize = false;
                           c.size=new Size(100,30);
                     }
               }
         }
Posted
Updated 21-Jul-10 3:26am
v2

1 solution

set the AutoSize property to false and change the height (not at design time but in code)

Good luck.
 
Share this answer
 
Comments
id-athul 3-Oct-13 7:13am    
Awesome trick....!!
Pawan Kiran 21-Jul-10 9:02am    
Reason for my vote of 5
Thanks to you it solves my issue.
Toli Cuturicu 21-Jul-10 18:23pm    
Then push Accept button

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900