Wrox Programmer Forums
Beginning Visual Basic 2015
This is the forum to discuss the Wrox book Beginning Visual Basic 2015 by Bryan Newsome; ISBN: 978-1-119-09211-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning Visual Basic 2015 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 29th, 2018, 05:35 AM
Registered User
Join Date: May 2018
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default 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.

Last edited by Harrycat310; June 29th, 2018 at 06:53 AM..

Similar Threads
Thread Thread Starter Forum Replies Last Post
showDialog(O); agplacid BOOK: Beginning Android 4 Application Development 0 October 21st, 2013 02:15 PM
Chapter2 - Showdialog mixieh BOOK: Beginning Android 4 Application Development 4 March 17th, 2013 02:25 PM
problem with ShowDialog() mori .NET Framework 2.0 0 August 21st, 2008 07:19 AM
Problem with form.ShowDialog() karveajit C# 1 October 6th, 2007 04:35 PM
Showdialog Help!!! KL VS.NET 2002/2003 1 December 15th, 2003 05:22 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.