Color conversion

xiaoxiao2021-03-06  97

I'm going back to me to reply to the coconut forest Dotnet's sky -----ASP.NET component programming step by step ------------------ # Reply: a little bug / / Here the color value is converted into hexadecimal String R, G, B; R = (convert.Toint32 (this._backroundcolor.r)). TOSTRING ("X"); g = (convert.Toint32 (this. _BACKGROUNDCOLOR.G)). TOSTRING ("x"); b = (convert.Toint32 (this._backroundcolor.b)). Tostring ("x"); if (r.Length == 1) R = "0" R; if (g.Length == 1) g = "0" g; if (b.Length == 1) b = "0" b; -------------- ---------------------

In fact, the following code can be replaced with a line of code to get it -----------------------------------------------------

R = (convert.Toint32 (this._backgroundcolor.r)). Tostring ("x");

G = (convert.Toint32 (this._backgroundcolor.g)). TOSTRING ("X");

B = (convert.Toint32 (this._backgroundcolor.b). Tostring ("x");

IF (r.Length == 1) r = "0" r; if (g.Length == 1) g = "0" g; if (b.Length == 1) b = "0" b ;

Table T = (Table) Controls [i];

T.attributes.Add ("ID", T.ClientID;

This.TextBox.attributes ["onfocus"] = "" "#" # "#" R g b ""; -------- changed - ------------------------ This.TextBox.attributes.add ("OnMouseover", "LTMouseOver (this, '" ColorTranslator.tohtml (this. _MouseOverColor) ")");

Simple! Inadvertently discovered! Because I think MS is not possible to convert a color to yourself.

转载请注明原文地址:https://www.9cbs.com/read-123311.html

New Post(0)