Home All Groups Group Topic Archive Search About

Renaming Form File Question

Author
13 Apr 2005 2:51 PM
Brian
Hello!

I am using a book that tells me to rename form1.vb in the Solution Explorer
and if I do this, the program never runs. It gives me a sorts of errors.
Starting with saying the EXE file is missing and then says:

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

It told me to rename form1.vb to fclsViewer.vb.

If I had left it alone, it would compile and run. Is this book in error and
left out a step or am I doing something wrong?

Thanks,
Brian

Author
13 Apr 2005 3:17 PM
Donzo
You have to change the class name to what you just renamed the form to.
If you go into the code view of the form you just changed the name of in the
solution explorer(fclsViewer.vb) you will notice that the class name is still
form1.  Change this to the new name (fclsViewer) and set the project to use
this form at startup.

Show quoteHide quote
"Brian" wrote:

> Hello!
>
> I am using a book that tells me to rename form1.vb in the Solution Explorer
> and if I do this, the program never runs. It gives me a sorts of errors.
> Starting with saying the EXE file is missing and then says:
>
> 'Sub Main' was not found in 'Picture_Viewer.Form1'.
>
> It told me to rename form1.vb to fclsViewer.vb.
>
> If I had left it alone, it would compile and run. Is this book in error and
> left out a step or am I doing something wrong?
>
> Thanks,
> Brian
>
>
>
Author
13 Apr 2005 3:41 PM
Brian
Yes..thank you. A "duh" moment for me.

Show quoteHide quote
"Donzo" <Do***@discussions.microsoft.com> wrote in message
news:373B7597-3229-4F9D-AC0D-F9BC2CC16BDA@microsoft.com...
> You have to change the class name to what you just renamed the form to.
> If you go into the code view of the form you just changed the name of in
> the
> solution explorer(fclsViewer.vb) you will notice that the class name is
> still
> form1.  Change this to the new name (fclsViewer) and set the project to
> use
> this form at startup.
>
> "Brian" wrote:
>
>> Hello!
>>
>> I am using a book that tells me to rename form1.vb in the Solution
>> Explorer
>> and if I do this, the program never runs. It gives me a sorts of errors.
>> Starting with saying the EXE file is missing and then says:
>>
>> 'Sub Main' was not found in 'Picture_Viewer.Form1'.
>>
>> It told me to rename form1.vb to fclsViewer.vb.
>>
>> If I had left it alone, it would compile and run. Is this book in error
>> and
>> left out a step or am I doing something wrong?
>>
>> Thanks,
>> Brian
>>
>>
>>