Summary description for ColorSliders.
Inheritance: System.Windows.Forms.Control
Beispiel #1
0
        public ColorPicker()
            : base()
        {
            cs_r = new ColorSlider();
            cs_g = new ColorSlider();
            cs_b = new ColorSlider();

            tx_r = new TextBox();
            tx_g = new TextBox();
            tx_b = new TextBox();

            tx_r.Text = "0";
            tx_g.Text = "0";
            tx_b.Text = "0";

            tx_r.TextChanged += new EventHandler(txChanged);
            tx_g.TextChanged += new EventHandler(txChanged);
            tx_b.TextChanged += new EventHandler(txChanged);

            tx_r.KeyPress += new KeyPressEventHandler(StopNonIntKeys);
            tx_g.KeyPress += new KeyPressEventHandler(StopNonIntKeys);
            tx_b.KeyPress += new KeyPressEventHandler(StopNonIntKeys);

            cs_r.ParentColor = colorInfo;
            cs_g.ParentColor = colorInfo;
            cs_b.ParentColor = colorInfo;

            cs_r.PrimaryColorChannel = ColorSlider.ColorChannel.Red;
            cs_g.PrimaryColorChannel = ColorSlider.ColorChannel.Green;
            cs_b.PrimaryColorChannel = ColorSlider.ColorChannel.Blue;

            cs_r.Location = new System.Drawing.Point(0,0);
            cs_g.Location = new System.Drawing.Point(0,32);
            cs_b.Location = new System.Drawing.Point(0,64);

            tx_r.Location = new System.Drawing.Point(136,0);
            tx_g.Location = new System.Drawing.Point(136,32);
            tx_b.Location = new System.Drawing.Point(136,64);

            cs_r.Size = new System.Drawing.Size(128,20);
            cs_g.Size = new System.Drawing.Size(128,20);
            cs_b.Size = new System.Drawing.Size(128,20);

            tx_r.Size = new System.Drawing.Size(32,20);
            tx_g.Size = new System.Drawing.Size(32,20);
            tx_b.Size = new System.Drawing.Size(32,20);

            Controls.Add(cs_r);
            Controls.Add(cs_g);
            Controls.Add(cs_b);
            Controls.Add(tx_r);
            Controls.Add(tx_g);
            Controls.Add(tx_b);

            colorInfo.ColorChanged += new ColorInfo.CEvent(colorInfo_ColorChanged);
        }
Beispiel #2
0
        public ColorPicker() : base()
        {
            cs_r = new ColorSlider();
            cs_g = new ColorSlider();
            cs_b = new ColorSlider();

            tx_r = new TextBox();
            tx_g = new TextBox();
            tx_b = new TextBox();

            tx_r.Text = "0";
            tx_g.Text = "0";
            tx_b.Text = "0";

            tx_r.TextChanged += new EventHandler(txChanged);
            tx_g.TextChanged += new EventHandler(txChanged);
            tx_b.TextChanged += new EventHandler(txChanged);

            tx_r.KeyPress += new KeyPressEventHandler(StopNonIntKeys);
            tx_g.KeyPress += new KeyPressEventHandler(StopNonIntKeys);
            tx_b.KeyPress += new KeyPressEventHandler(StopNonIntKeys);

            cs_r.ParentColor = colorInfo;
            cs_g.ParentColor = colorInfo;
            cs_b.ParentColor = colorInfo;

            cs_r.PrimaryColorChannel = ColorSlider.ColorChannel.Red;
            cs_g.PrimaryColorChannel = ColorSlider.ColorChannel.Green;
            cs_b.PrimaryColorChannel = ColorSlider.ColorChannel.Blue;

            cs_r.Location = new System.Drawing.Point(0, 0);
            cs_g.Location = new System.Drawing.Point(0, 32);
            cs_b.Location = new System.Drawing.Point(0, 64);

            tx_r.Location = new System.Drawing.Point(136, 0);
            tx_g.Location = new System.Drawing.Point(136, 32);
            tx_b.Location = new System.Drawing.Point(136, 64);

            cs_r.Size = new System.Drawing.Size(128, 20);
            cs_g.Size = new System.Drawing.Size(128, 20);
            cs_b.Size = new System.Drawing.Size(128, 20);

            tx_r.Size = new System.Drawing.Size(32, 20);
            tx_g.Size = new System.Drawing.Size(32, 20);
            tx_b.Size = new System.Drawing.Size(32, 20);

            Controls.Add(cs_r);
            Controls.Add(cs_g);
            Controls.Add(cs_b);
            Controls.Add(tx_r);
            Controls.Add(tx_g);
            Controls.Add(tx_b);

            colorInfo.ColorChanged += new ColorInfo.CEvent(colorInfo_ColorChanged);
        }