Chris-Manginelli
asked on
Creating Color Dialog
I'm new to VB programming, and am watching the Teir 1 tutorial provided by Microsoft (http://msdn.microsoft.com/en-us/beginner/bb308891.aspx). I'm trying to make a button which opens a color dialog box and changes the background color of the window based off the color chosen in the dialog box. Unfortunately, even coding it exactly the way it is in the tutorial, I get debug errors.
My Errors:
Error 1 Name 'ColorDialog1' is not declared. C:\Users\mangin\Documents\ Visual Studio 2008\Projects\WindowsAppli cation2\Wi ndowsAppli cation2\Fo rm1.vb 3 9 WindowsApplication2
Error 2 Name 'ColorDialog1' is not declared. C:\Users\mangin\Documents\ Visual Studio 2008\Projects\WindowsAppli cation2\Wi ndowsAppli cation2\Fo rm1.vb 4 24 WindowsApplication2
I don't understand how the girl in the tutorial has no problems with this exact coding. Any suggestion helps.
My Errors:
Error 1 Name 'ColorDialog1' is not declared. C:\Users\mangin\Documents\
Error 2 Name 'ColorDialog1' is not declared. C:\Users\mangin\Documents\
I don't understand how the girl in the tutorial has no problems with this exact coding. Any suggestion helps.
Public Class Form1
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
End Class
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thank you both!
ColorDialog.jpg