[C#]Scroll

강서현·2022년 3월 28일
0

C#

목록 보기
17/23
  • From 디자인

  • 코드
this.BackColor = Color.LightSteelBlue;
            panel1.BackColor = Color.FromArgb(0, 0, 0); 
            <!--Color.Black; -->
            textBox1.Text = "0";
            textBox2.Text = "0";
            textBox3.Text = "0";

            hScrollBar1.Maximum = 255 + 9; <!--스크롤을 끝까지 땡겨도 255가 안나와서 +9 -->
            hScrollBar2.Maximum = 255 + 9;
            hScrollBar3.Maximum = 255 + 9;
        }

        private void scr_Scroll(object sender, ScrollEventArgs e)
        {
            textBox1.Text = hScrollBar1.Value.ToString();
            textBox2.Text = hScrollBar2.Value.ToString();
            textBox3.Text = hScrollBar3.Value.ToString();
            panel1.BackColor = Color.FromArgb(hScrollBar1.Value, hScrollBar2.Value, hScrollBar3.Value);
        }

        private void txt_TextChanged(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "")
            {
                hScrollBar1.Value = int.Parse(textBox1.Text);
                hScrollBar2.Value = int.Parse(textBox2.Text);
                hScrollBar3.Value = int.Parse(textBox3.Text);
                panel1.BackColor = Color.FromArgb(hScrollBar1.Value, hScrollBar2.Value, hScrollBar3.Value);
            }
        }
profile
Recording...

0개의 댓글