Author |
Topic |
saidev
Posting Yak Master
101 Posts |
Posted - 2006-09-13 : 00:37:26
|
Hi Guys,I am displaying one of the ID number in the Text box. I want that Number to be in Red Color, not the Text box just the number. can you guys help me what are the properties i need to set in order to display the number in Red Color. I am using ASP.NET/VB.NETappreciate your helpThanks, |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-13 : 00:43:53
|
Text1.TextColor = vbRedPeter LarssonHelsingborg, Sweden |
 |
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2006-09-13 : 01:11:31
|
quote: Originally posted by Peso Text1.TextColor = vbRedPeter LarssonHelsingborg, Sweden
That's VB6 unless I'm very much mistaken.....saidev:You should really RTFM before posting these sorts of questions.... |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-13 : 01:24:04
|
I think this is true even in VB.Net and ASP.NetPeter LarssonHelsingborg, Sweden |
 |
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2006-09-13 : 01:27:43
|
I think the enums are named differently, that's all. |
 |
|
dfiala
Posting Yak Master
116 Posts |
Posted - 2006-09-13 : 01:35:32
|
TextBox.ForeColor = Color.Redor SelectName.ForeColor = System.Drawing.Color.Red if you haven't Imported System.DrawingOf course, using a CssClass will make your life easier in the long run.Dean FialaVery Practical Software, IncNow with Blogging...http://www.vpsw.com/blogbabyMicrosoft MVP |
 |
|
saidev
Posting Yak Master
101 Posts |
Posted - 2006-09-13 : 15:05:59
|
Hi guys,when i uses this property it doesn't work for me. can you guys tell me why..?Thanks, Me.txtContractNo.ForeColor() = Color.RedorMe.txtContractNo.ForeColor = Color.Redi tried both of them but didn't work |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-13 : 15:09:47
|
Where did you put the code to color the text red?Why are you using ForeColor? Try TextColor.Peter LarssonHelsingborg, Sweden |
 |
|
saidev
Posting Yak Master
101 Posts |
Posted - 2006-09-13 : 16:21:32
|
Hi,TextColor was not in VB.NET. I put this code in page_load also i tried in where i populate the Data. Still it doesn't workThanks |
 |
|
dfiala
Posting Yak Master
116 Posts |
Posted - 2006-09-13 : 16:28:51
|
This works perfectly fine... Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load TextBox1.ForeColor = Color.RedEnd SubWhat does your rendered html look like for the text box? Check the View Source on the browser. It should look something like this... <input name="TextBox1" type="text" id="TextBox1" style="color:Red;" />Dean FialaVery Practical Software, IncNow with Blogging...http://www.vpsw.com/blogbabyMicrosoft MVP |
 |
|
saidev
Posting Yak Master
101 Posts |
Posted - 2006-09-14 : 13:32:16
|
Hi,I tried this but still doesnot work. i have code in HTML like thisTHanks<asp:textbox id="txtContractNo" style="Z-INDEX: 115; LEFT: 152px; POSITION: absolute; TOP: 160px"tabIndex="2" runat="server" Width="160px" CssClass="txtContractNo" ForeColor="Red"></asp:textbox> |
 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-09-14 : 13:40:40
|
quote: Originally posted by saidev Hi,I tried this but still doesnot work. i have code in HTML like thisTHanks<asp:textbox id="txtContractNo" style="Z-INDEX: 115; LEFT: 152px; POSITION: absolute; TOP: 160px"tabIndex="2" runat="server" Width="160px" CssClass="txtContractNo" ForeColor="Red"></asp:textbox>
What is the CSS definition for txtContracNo ? That is a horrible way to use CSS, by the way -- of you want an individual style for an individual element, you should use #ID syntax on your style sheet.- Jeff |
 |
|
|