A tool for generating html hexcolor.


PHP Code:
//---------------------------------------------------------------------\\
//  ColorCode C# Application by Thinktank2 [email][email protected][/email]        )
//---------------------------------------------------------------------//

using System;
using System.Drawing;
using System.Windows.Forms;

class 
ColorCode Form
{
    private 
HScrollBar[] HsClr = new HScrollBar[3];
    private 
TextBox txtColor  = new TextBox();
    private 
Label lblColor = new Label();
    private 
Color Clr = new Color();

        public 
ColorCode()
    {

        
this.Text "Color Code 1.0";
        
this.StartPosition FormStartPosition.CenterScreen;
        
this.ClientSize = new Size(208157);
        
this.MaximizeBox false;
        
this.MinimizeBox false;

        
lblColor.Location = new Point(248);
        
lblColor.Size = new Size(6432);
        
lblColor.BorderStyle BorderStyle.Fixed3D;
        
lblColor.BackColor Color.Black;
        
this.Controls.Add(lblColor);

        
txtColor.Location = new Point(10416);
        
txtColor.Size = new Size(8020);
        
txtColor.Text "#000000";
        
this.Controls.Add(txtColor);
        
        
Label[] lblClrLegend = new Label[3];

        for(
int i=0HsClr.Lengthi++)
        {
            
lblClrLegend[i] = new Label();
            
lblClrLegend[i].Location = new Point(860 + (i*35));
            
lblClrLegend[i].Width 10;
            
lblClrLegend[i].Font = new Font(lblClrLegend[i].Font,FontStyle.Bold);
            
this.Controls.Add(lblClrLegend[i]);

            
HsClr[i] = new HScrollBar();
            
HsClr[i].Maximum 255;
            
HsClr[i].Location = new Point(2560 + (i*35));
            
HsClr[i].Size = new Size(17516);
            
HsClr[i].LargeChange 1;
            
HsClr[i].Scroll += new ScrollEventHandler(HsClr_Scroll);
            
this.Controls.Add(HsClr[i]);
        }
        
        
lblClrLegend[0].Text "R";
        
lblClrLegend[1].Text "G";
        
lblClrLegend[2].Text "B";

    }

        public static 
void Main(string[] args)
    {
            
Application.Run(new ColorCode());
        }


    protected 
void HsClr_Scroll(object senderScrollEventArgs e)
    {
        
Clr Color.FromArgb(HsClr[0].Value,HsClr[1].Value,HsClr[2].Value);
        
lblColor.BackColor Clr;
        
txtColor.Text ColorTranslator.ToHtml(Clr);
    }