Newbie question: Changing a form name

  • Thread starter Thread starter Andrew Thomas
  • Start date Start date
A

Andrew Thomas

Hello,
I have just started Visual Basic .net and I have purchased the
book "Teach Yourself Visual Basic.net 2003 in 24 hours" by James Foxall.
In the first chapter he shows me how to create a form (Form1) and then
change
its Name property by scrolling down to the Design section to see the (Name)
property.
When I do change the name, however, it no longer compiles giving me the
error

'Sub Main' was not found in 'picture_viewer.Form1'

Is the book wrong? What else do I have to change?

Thanks a lot,

Andrew Thomas.
 
Andrew said:
Hello,
I have just started Visual Basic .net and I have purchased the
book "Teach Yourself Visual Basic.net 2003 in 24 hours" by James Foxall.
In the first chapter he shows me how to create a form (Form1) and then
change
its Name property by scrolling down to the Design section to see the (Name)
property.
When I do change the name, however, it no longer compiles giving me the
error

'Sub Main' was not found in 'picture_viewer.Form1'

Is the book wrong? What else do I have to change?

Hi Andrew,

change Public Class Form1 to Public Form <Your New Name>

However, VS.NET should change this automatically.

Cheers

Arne Janning
 
Thomas,

Probably did you change the class name itself.

On the otherhand you should never change the code in the designer (the
enclosed) part of the form when you are not really knowing what you are
doing (when you are a newbie).

For that is the property box from the form.

I hope this helps and when not reply?

Cor
 
Hi,
Thanks for your responses but it emerges the problem was that I had to
set the new startup form name in the project. VB doesn't change that.

So the book WAS wrong.

Thanks anyway,

Andrew.
 
Back
Top