Change Background Color Using Color Dialog in VB.Net

This Tutorial is all about Change Background Color Using Color Dialog in VB.Net. In this tutorial about Change Background Color Using Color Dialog in VB.Net, you will be able to Change Background Color Using Color Dialog in VB.Net.

On the Microsoft Windows Application, the Color Dialog box is used to display the Color Dialog box and the color choices. It allows users to modify or set the color of an object, such as a control’s background color or the color used to paint an object.

Furthermore, the control dialog box gives the user the option of mixing all of the other colors in the Color Dialog Box to create a new color.

The ColorDialog control class represents a standard dialog box that displays available colors and controls for defining custom colors. It allows the user to choose a color.

So lets get Started:

  • First is open the Visual Basic, Select File on the menu, then click New and create a new project.

  • Then a New Project Dialog will appear. You can rename your project, depending on what you like to name it. After that click OK

  • After that, design your form like this just like what I’ve shown you below.
    Add a Button and a ColorDialog from the Toolbox. Just Drag the ColorDialog in the Form.
  • Then Add this Following Codes to the Button.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ColorDialog1.ShowDialog()Me.BackColor = ColorDialog1.Color
    End Sub
  • Finally, Click F5 to run the program.
    Output:

If you have any comments or suggestions about on Background Color Using Color Dialog in VB.Net, please feel free to contact our webpage.

Download Source Code! Here

Other Articles Readers might read:

Leave a Comment