Color RGB in Visual Studio 2017?

Asked

Viewed 596 times

2

How do I get more colors for the bottom of my form? I have a color in RGB and do not know how to put it beyond the colors already offered in Visual Studio 2017. I have tried searching the internet and found nothing

Opções oferecidas

  • is in Customize, there you create!

  • How? There only saw more color options

2 answers

0


In the archive Form1.cs(name of your form) within public Form1()(name of your form) enter the following code:

this.BackColor = Color.FromArgb(255, 232, 232); //os 3 parâmetros são os valores RGB

With this you can change the color of your form programmable. If you want a reference via Youtube here you are.

  • Thank you very much! To change the background of the tool 'panel' the same command is used?

  • You need to access the Panel object (through its name, just like I did with only that instead of this you put the name of the object variable), but yes it is the same logic.

0

In addition to the answer so you can change the value RGB by programming path, in that box you opened just type the RGB separated by ; which is automatically generated, example:

inserir a descrição da imagem aqui

All components that have color configuration can also be used the same strategy.

Just out of curiosity the code generated below is :

this
     .textBox1
     .ForeColor = System
        .Drawing
        .Color
        .FromArgb(((int)(((byte)(100)))), ((int)(((byte)(253)))), ((int)(((byte)(80)))));
  • 1

    Perfect Virgilio, thank you so much! <3

Browser other questions tagged

You are not signed in. Login or sign up in order to post.