Newbie question: Changing a form name

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.
 
A

Arne Janning

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
 
C

Cor Ligthert

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
 
A

Andrew Thomas

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

OpenFileDialog filter 1
New to VB.net, hence Newbie question 14
Changing a forms name 27
open file? 8
Data Access 5
Changing the main form 3
Module Name Change 101 1
How to call a load a form in vb.net? 1

Top