Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A neat little UI trick to change the color of changed Te
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00719469
Message ID:
00719503
Views:
13
This message has been marked as the solution to the initial question of the thread.
Try this in the client code:
<HTML>
<HEAD>
<STYLE>
.normal {background-color: #FFFFFF;}
.changed {background-color: "#AAAAFF";}
</STYLE>

<SCRIPT>
function fnSetStyle(object){
 object.className = "changed";
}
function fnRemoveStyle(object){
 object.className = "normal";
}
</SCRIPT>
And the textboxt tag add the CLASS and OnChange:
<INPUT TYPE="text" CLASS="normal" onChange="fnSetStyle(this)" NAME="oInput">
>All,
>
>I just thought this was interesting:
>
>In your InitializeComponent:
>
>this.myTextBox.TextChanged += new System.EventHandler(this.TextBox_Changed);
>
>
>The event to process:
>
>private void TextBox_TextChanged(object sender, System.EventArgs e)
>{
>     ((TextBox)sender).ForeColor = System.Drawing.Color.Red;
>}
>
>
>Pretty Simple. Note this does not change the color until after the page has been posted.
>Is there a cute way to do this so that the control could generate the JS necessary to do this in RealTime?
>
>Doug
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform