Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have windows application ....i have one form who have two textbox..textbox border style is set to Fixed3d....when i disable the textbox it chang the border style...it look very bad...pls help me
Posted

If windows form then it is default behaviour
you can make textbox readonly = true and set it's BackgroundColor = grey.
and for enable textbox readonly = false and set it's BackgroundColor = white.
Happy Coding!
:)
 
Share this answer
 
HI
whenever you are disabling a textbox with border fixed3d you can change it to FixedSingle or None

C#
textBox1.Enabled = false;
           textBox1.BorderStyle = BorderStyle.FixedSingle;


C#
textBox1.Enabled = true;
          textBox1.BorderStyle = BorderStyle.Fixed3D;
 
Share this answer
 
Comments
kavita painter 26-Dec-13 4:50am    
but i want only fixed3d at disable and enable both time...Is it posible?
Karthik_Mahalingam 26-Dec-13 4:54am    
whenever u enable the textbox, u can use thse code..
textBox1.Enabled = true;
textBox1.BorderStyle = BorderStyle.Fixed3D;
similarly to disable u can use these
textBox1.Enabled = false;
textBox1.BorderStyle = BorderStyle.FixedSingle;
kavita painter 26-Dec-13 4:56am    
but i want only fixed3d border style at disable time
Karthik_Mahalingam 26-Dec-13 4:55am    
try with Aarti Meswania's solution 2
try this

textBox1.Enabled = true;
textBox1.BackColor = Color.White;


or

textBox1.ReadOnly = true;
textBox1.BackColor = Color.White;
 
Share this answer
 

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