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

namespace _11_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void argb()
        {
            int r, g, b;
            r = hScrollBar1.Value;
            g = hScrollBar2.Value;
            b = hScrollBar3.Value;
            //----------------------------------------------------------
            panel1.BackColor = Color.FromArgb(r, g, b);
            label5.Text = string.Format("{0:X4}{1:X4}{2:X4}", r, g, b);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            hScrollBar1.Maximum = 255;
            hScrollBar1.LargeChange = 1;
            hScrollBar1.Value = 255;
            //-----------------------------
            hScrollBar2.Minimum = 0;
            hScrollBar2.Maximum = 255;
            hScrollBar2.LargeChange = 1;
            //-----------------------------
            hScrollBar3.Minimum = 0;
            hScrollBar3.Maximum = 255;
            hScrollBar3.LargeChange = 1;
            //-----------------------------
            argb();
        }

        private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
        {
            argb();
        }

        private void hScrollBar2_Scroll(object sender, ScrollEventArgs e)
        {
            argb();
        }

        private void hScrollBar3_Scroll(object sender, ScrollEventArgs e)
        {
            argb();
        }
    }
}