Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Experts !!

Am using this below text Inside of Textbox, and i need to change the color of this text to light gray Color. By the way i used this text to search the records.

this is the code.., in code behind page of asp.net C#
C#
txtSearch.Attributes.Add("value", "Search HNumber, SId, RoomNo, to Narrow the Results.....");


Please can anyone suggest me to how to do this ? ?

Thanks,
Posted
Updated 14-May-12 0:29am
v2

What about:
C#
TextBox1.Text = "Some content colored";
TextBox1.ForeColor = System.Drawing.Color.LightGray;
 
Share this answer
 
v2
Comments
Vipin_Arora 17-May-12 0:41am    
to the point: +5
Sandeep Mewara 17-May-12 1:33am    
Thanks.
C#
TextBox1.ForeColor = System.Drawing.Color.LightGray;
 
Share this answer
 
Comments
[no name] 15-May-12 3:18am    
What is this? If you know solution one is correct then you should not write the same code as your solution. If you know more then give some different idea. Stupid work.
Vipin_Arora 16-May-12 23:40pm    
Dear Amit Sir, this is humble request to you that please do not use these kind of words or language. Insults are not welcome.

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