473,508 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing a forms name

When I'm changing a forms name in the project and this form is a startup form (set in the project properties), I get an error that the function "sub main" is not found. The visual basic should automaticly change it's name in the project properties as it changes it automaticly in the code window.

Is there any fixes for it?
(I'm using Visual Studio .NET 2003)
Nov 20 '05 #1
27 2571
* =?Utf-8?B?QWxleCBMZXZp?= <Al******@discussions.microsoft.com> scripsit:
When I'm changing a forms name in the project and this form is a
startup form (set in the project properties), I get an error that the
function "sub main" is not found. The visual basic should automaticly
change it's name in the project properties as it changes it automaticly
in the code window.


Doubleclick the error. A dialog will popup that lets you select the new
startup form. If it doesn't, go to the project options dialog and set
the startup object there.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
I know that I can change the startup form manually, but is there a way that it would change automaticly as the code windows does?

"Herfried K. Wagner [MVP]" wrote:
* =?Utf-8?B?QWxleCBMZXZp?= <Al******@discussions.microsoft.com> scripsit:
When I'm changing a forms name in the project and this form is a
startup form (set in the project properties), I get an error that the
function "sub main" is not found. The visual basic should automaticly
change it's name in the project properties as it changes it automaticly
in the code window.


Doubleclick the error. A dialog will popup that lets you select the new
startup form. If it doesn't, go to the project options dialog and set
the startup object there.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3
* =?Utf-8?B?QWxleCBMZXZp?= <Al******@discussions.microsoft.com> scripsit:
I know that I can change the startup form manually, but is there a way that it would change automaticly as the code windows does?


I don't think so. But that's a two-clicks task.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
I know that I can change the startup form manually, but is there a way that it would change automaticly as the code windows does?


No. You'll have to wait for VS 2005.
Nov 20 '05 #5
Hi Alex,

Are you sure you want to change the Name of the class and not only the name
of the form which you can do with me.Text?

And when not, maybe you will tell us what is the reason that you want to
change the name of the Form (the object) and is it when you want to do that
a problem that you have to change the startup Form Class name in the project
properties (The startup form holds internally a Sub Main from the Form class
which it inherit)?

Cor
Nov 20 '05 #6
Does Visual Studio 2005 fixed this BUG?

"Jeff Johnson [MVP: VB]" wrote:

"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
I know that I can change the startup form manually, but is there a way

that
it would change automaticly as the code windows does?


No. You'll have to wait for VS 2005.

Nov 20 '05 #7
Alex,

Actually I think what you are seeing as a bug is probably intended behavior.
It just isn't the most desirable behavior. Visual Studio does not crash
when you change the name of the startup form, it simply asks you to select a
new startup class.

-Sam Matzen
"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
There is no special reason for changing the name, I just thought that this BUG can be resolved some how.

"Cor Ligthert" wrote:
Hi Alex,

Are you sure you want to change the Name of the class and not only the name of the form which you can do with me.Text?

And when not, maybe you will tell us what is the reason that you want to
change the name of the Form (the object) and is it when you want to do that a problem that you have to change the startup Form Class name in the project properties (The startup form holds internally a Sub Main from the Form class which it inherit)?

Cor

Nov 20 '05 #8

"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
Does Visual Studio 2005 fixed this BUG?


That's what I meant by:
No. You'll have to wait for VS 2005.

Nov 20 '05 #9
Hi Jeff,

You mean that when I in VS2005 change the name of the by the building of the
project by the wizard created form change, that that new name will be set as
the startup project?

I hope it is not.

By the way, I cannot call it a bug as you do, that when after that the
wizard did its work there is not wizard action anymore.

Cor
Does Visual Studio 2005 fixed this BUG?


That's what I meant by:
No. You'll have to wait for VS 2005.


Nov 20 '05 #10
Hi Alex,

Setting the startup name in the properties is an action from the project
building wizard, that stops working after the first building is done.

That is normal behaviour of every wizard.

Why you call this a bug?

Cor
Nov 20 '05 #11

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:u2**************@tk2msftngp13.phx.gbl...
You mean that when I in VS2005 change the name of the by the building of the project by the wizard created form change, that that new name will be set as the startup project?
If you create a Windows application you will get the default Form1 and it
will be set as the startup form (form, not project). If you subsequently
change the form's name (say, to frmMain), VS 2005 will change the startup
form to match it so you don't have to manually go into the project
properties and do it like you have to now.

If a different form (or Sub Main) is set as the startup form, nothing will
happen when you rename this form. VS 2005 simply synchronizes your name
change across the project.
By the way, I cannot call it a bug as you do, that when after that the
wizard did its work there is not wizard action anymore.


"Bug" was the original poster's word, not mine.
Nov 20 '05 #12

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Setting the startup name in the properties is an action from the project
building wizard, that stops working after the first building is done.

That is normal behaviour of every wizard.

Why you call this a bug?


It's more of an oversight. If the project was set for Form1 to be the
startup form and you change Form1's name to frmMain, it's silly for Visual
Studio to still have the startup form set to Form1 when such a form no
longer exists in the project.
Nov 20 '05 #13
Hi Jeff,

After overthinking it, I think that understand my misunderstanding, I never
change the class name in the designer. I agree that when you do it that way,
what is probably ment here, it can change the properties as well from the
startup project.

Cor
Nov 20 '05 #14
Hi Alex,

I never change the class name using the designer, when you do it that way,
it can as well automaticly be done for the startup project, I agree that
with you, however to call it a bug is something to much, you can call it a
small disadvantage in my opinion.

Cor
Nov 20 '05 #15

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:um**************@tk2msftngp13.phx.gbl...
After overthinking it, I think that understand my misunderstanding


The wise man knows what he does not know.
Nov 20 '05 #16
* "Jeff Johnson [MVP: VB]" <i.***@enough.spam> scripsit:
Setting the startup name in the properties is an action from the project
building wizard, that stops working after the first building is done.

That is normal behaviour of every wizard.

Why you call this a bug?


It's more of an oversight. If the project was set for Form1 to be the
startup form and you change Form1's name to frmMain, it's silly for Visual
Studio to still have the startup form set to Form1 when such a form no
longer exists in the project.


I agree, if the form is /deleted/, then the user should get prompted for
selecting the startup form. Nevertheless, when simply /renaming/ the
class that is treated as startup form, VB should set the renamed form as
startup form automatically or ask if it should be taken as startup form.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #17
* "Cor Ligthert" <no**********@planet.nl> scripsit:
You mean that when I in VS2005 change the name of the by the building of the
project by the wizard created form change, that that new name will be set as
the startup project?
Startup project? Startup form?
I hope it is not.

By the way, I cannot call it a bug as you do, that when after that the
wizard did its work there is not wizard action anymore.


I never used a wizard to create a Windows Forms application, but there
was still a startup form selected automatically.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #18
* =?Utf-8?B?QWxleCBMZXZp?= <Al******@discussions.microsoft.com> scripsit:
Mayble, but I'm not deleting a form, just changing it's name.
So VB.NET should change it's name anyware, including in the project properies, like it does in the code window.
If I were deleting the form, then I would agree with you that the user must re-enter a new form as for a startup form.


I agree, it would be nice if that would work. I didn't take a look, but
I assume that this will be done automatically in VB 2005.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #19
Hi Herfried,

Try in VS IDE File->New->Project than opens a window choose Visual Basic
Projects and than Windows Application. Give the name for your application.

A wizard will than generate a complete project for you. (Such a thing is
called a wizard even if it is not named a wizard)

I understand from you that you use empty project, however I find that to
much work.

:-)

Cor
I never used a wizard to create a Windows Forms application, but there
was still a startup form selected automatically.

Nov 20 '05 #20

"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com...
Is it possible to have a fix or an update to VS .NET 2003 for this problem? I just work a lot with students and show them how to work in VS so I'm
changing the form's names a lot, and I alwase have to change the startup form. It would be much easier to work with if this problem would some how

resolved.

I doubt MS will "fix" it in existing version if Visual Studio. Perhaps a
macro or an add-in could be created, but that would probably be a lot more
trouble than it's worth. It's just one error. Teach your students how to
handle it.
Nov 20 '05 #21
* "Cor Ligthert" <no**********@planet.nl> scripsit:
Try in VS IDE File->New->Project than opens a window choose Visual Basic
Projects and than Windows Application. Give the name for your application.

A wizard will than generate a complete project for you. (Such a thing is
called a wizard even if it is not named a wizard)


OK, I didn't consider that to be a wizard, I thought that's a
"template".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #22

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de...
Try in VS IDE File->New->Project than opens a window choose Visual Basic Projects and than Windows Application. Give the name for your application.
A wizard will than generate a complete project for you. (Such a thing is
called a wizard even if it is not named a wizard)


OK, I didn't consider that to be a wizard, I thought that's a
"template".


I think someone needs to make a formal definition of "Wizard" as requiring
more than one "page" before it completes its job. I've never thought of the
New Project dialog as a wizard either.
Nov 20 '05 #23
> Does Visual Studio 2005 fixed this BUG?

I wouldn't call it a bug.... I've never in all my years had a problem with
this, i'd say if anything it's a slight inconvenience.

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
Does Visual Studio 2005 fixed this BUG?

"Jeff Johnson [MVP: VB]" wrote:

"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
I know that I can change the startup form manually, but is there a way

that
it would change automaticly as the code windows does?


No. You'll have to wait for VS 2005.

Nov 20 '05 #24
* =?Utf-8?B?QWxleCBMZXZp?= <Al******@discussions.microsoft.com> scripsit:
Is it possible to have a fix or an update to VS .NET 2003 for this problem?
There is nothing to fix. This behavior is IMO "by design".
I just work a lot with students and show them how to work in VS so I'm
changing the form's names a lot, and I alwase have to change the startup
form.


OK, I understand that this is a very special situation, but I never had
a problem with that because you see an error in the tasklist and can
select the new startup form using an UI, so that's a pretty easy task.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #25
* "Tom Spink" <thomasdotspinkatsp@mntlworlddotcom> scripsit:
Does Visual Studio 2005 fixed this BUG?


I wouldn't call it a bug.... I've never in all my years had a problem with
this, i'd say if anything it's a slight inconvenience.


The behavior changed in VB 2005. Renaming the /file/ will rename the class,
and renaming the class will cause VB to update the startup object.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #26
* "Jeff Johnson [MVP: VB]" <i.***@enough.spam> scripsit:
OK, I didn't consider that to be a wizard, I thought that's a
"template".


I think someone needs to make a formal definition of "Wizard" as requiring
more than one "page" before it completes its job. I've never thought of the
New Project dialog as a wizard either.


Wizards, IMO, have a certain look, there is a common set of buttons
("Next >", "Finish", ...). Still, there is kind of magic in how VS puts
together the project from the template ;-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #27
I agree that this is not a difficult task but it would be nice to have it fixed.

"Herfried K. Wagner [MVP]" wrote:
* =?Utf-8?B?QWxleCBMZXZp?= <Al******@discussions.microsoft.com> scripsit:
Is it possible to have a fix or an update to VS .NET 2003 for this problem?


There is nothing to fix. This behavior is IMO "by design".
I just work a lot with students and show them how to work in VS so I'm
changing the form's names a lot, and I alwase have to change the startup
form.


OK, I understand that this is a very special situation, but I never had
a problem with that because you see an error in the tasklist and can
select the new startup form using an UI, so that's a pretty easy task.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #28

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5166
by: Jason Dykes | last post by:
I have a page that is database driven. The pages shows a user's name and whether they have access to our site or not. this is done by displaying two checkboxes positioned to the right of the users...
7
6047
by: Stefan Finzel | last post by:
Hi, is there a way to change the display property on Windows Mobile 2003 SE Mobile/Pocket Internet Explorer? See following example. Please note: visibilty property has the same problem. Is...
10
15341
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have...
5
2932
by: David | last post by:
Hi I seem to be getting nowhere with this. I am opening a form which will be used to input Notes into different fields in a table. My problem is changing the unbound field name to the field name...
4
2428
by: Tony W | last post by:
Hi, I am trying to write a simple application to retrieve data from the Windows registry and insert it into textboxs on a windows form. So far I have one namespace containing two classess. ...
6
10462
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
7
2929
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and...
1
2664
by: mplus_2000 | last post by:
I have recently inherited a database. The switchboard (and other forms) displays the name of the database on it (top, center). Currently the name that appears is Reviews. There are plans to roll...
8
4332
Megalog
by: Megalog | last post by:
Hey guys.. my turn to ask a question: I'm having a weird issue with a form I've reworked. This form has a combo box, which when used is changing the recordsource of a subform. This subform has...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.