ColorDialog1.ShowDialog
I am having a problem with Chapter 7 Windows Forms Dialogs Code. I have copied the code from the Book
Private Sub btnColor_Click(sender As Object, e As EventArgs) Handles btnColor.Click
'Show The Color Dialog And If The User Clicks The Ok Button
'Update The Background Color Of The Form
If ColorDialog1.ShowDialog = System.Windows.Forms.DialogResult.OK Then
Me.BackColor = ColorDialog1.Color
End If
End Sub
and ColorDialog1 is underlined in red and an error code BC30451 is generated with the message ColorDialog1 is not declared. It may be inaccessible due to its protection level. I have even copied and pasted the code from the downloaded examples and still get the same.
Can someone please help as I can't see what is wrong.
Many Thanks.
Harrycat310.
Last edited by Harrycat310; June 29th, 2018 at 06:53 AM..
|