ColorDialog Tutorial in VB.NET
Submitted by donbermoy on Saturday, March 1, 2014 - 17:57.
Color Dialog is one of the important features in VB.NET. It represents a common dialog box that displays available colors along with controls that enable the user to define custom colors.
Now, let's start this Color Dialog tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.
2. Next, add only one Button named Button1 and labeled it as "Change Background Color". Next, put a ColorDialog as a dialog box control in your toolbox.
3. Add ColorDialog from the toolbox:
4. Now put add this code for your code module. This code is for Button1_Click:
When picking or choosing a color from the color dialog box, the background color of the from will change as we have the code
Download the source code below and try it! :)
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,


- 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
Explanation:
ColorDialog1.ShowDialog()
- is our syntax for opening the color dialog box. It will look like this one when you click the button.

Me.BackColor = ColorDialog1.Color
. This means that the value of the color you choose in you colordialog will be equal to the background color of your form.
Now, click the Ok from your ColorDialog. It will change the back color of your form like this:

Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Mobile: 09079373999
Telephone: 826-9296
E-mail:[email protected]
Visit and like my page on Facebook at: Bermz ISware Solutions
Subscribe at my YouTube Channel at: SerBermz
Add new comment
- 396 views