C#-trackbar-rgb color form background color, dynamically load color effect, set by TrackBar, value 255.---Shinepans

Source: Internet
Author: User

Using system;using system.collections.generic;using system.componentmodel;using system.data;using System.Drawing; Using system.linq;using system.text;using system.threading.tasks;using system.windows.forms;namespace Setting the form color _        trackbar_{public partial class Form1:form {public Form1 () {InitializeComponent (); private void Form1_Load (object sender, EventArgs e) {TextBox1.Text = TrackBar1.Value.ToStr            ING ();            TextBox2.Text = TrackBar2.Value.ToString ();            TextBox3.Text = TrackBar3.Value.ToString (); This.                    BackColor = Color.FromArgb (Trackbar1.value, Trackbar2.value, Trackbar3.value); private void Trackbar1_scroll (object sender, EventArgs e) {TextBox1.Text = TrackBar1.Value.ToS            Tring ();            Form1 frm = this; frm.        BackColor = Color.FromArgb (Trackbar1.value, Trackbar2.value, Trackbar3.value); } private void Trackbar2_scroll (objECT sender, EventArgs e) {TextBox2.Text = TrackBar2.Value.ToString ();            Form1 frm = this; frm.        BackColor = Color.FromArgb (Trackbar1.value, Trackbar2.value, Trackbar3.value); private void Trackbar3_scroll (object sender, EventArgs e) {textbox3.text = TrackBar3.Value.ToS            Tring ();            Form1 frm = this; frm.        BackColor = Color.FromArgb (Trackbar1.value, Trackbar2.value, Trackbar3.value); }    }}



by FromArgb 0-255 values to set the color, joined the TrackBar, I think of the win 8 installation of the color gradient, that is, using this principle, you can do immediately.


Next we'll do a


Effect and Source code:





Http://yunpan.cn/csJwjgxLF65rD Extract Code B1A5

C#-trackbar-rgb color form background color, dynamically load color effect, set by TrackBar, value 255.---Shinepans

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.