Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A neat little UI trick to change the color of changed Te
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00719469
Message ID:
00719503
Vues:
14
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform