473,796 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Form1" name unwanted

I rename "Form1.cs" on the right to the desired name, and also go into
properties of the form and name it in the (name) section. After
building, Form1.cs appears in the code and gives an error. I was told
not to double-click anything, but it still happened. How to fix?
Nov 16 '05 #1
4 2178
Tim923 wrote:
I rename "Form1.cs" on the right to the desired name, and also go into
properties of the form and name it in the (name) section. After
building, Form1.cs appears in the code and gives an error. I was told
not to double-click anything, but it still happened. How to fix?

That would be in void main?
Just change it to whatever you renamed form1 to.

Cheers
JB
Nov 16 '05 #2
>That would be in void main?
Just change it to whatever you renamed form1 to.


Wow, fast response.

Is there a way to rename "Form1" without having to change code (like I
have been doing), or is "Form1" in the code as soon as the user starts
a new project?

I thought the .cs file name and the name in the (name) section in form
properties should match, but need they?
Nov 16 '05 #3
Tim923 wrote:
That would be in void main?
Just change it to whatever you renamed form1 to.

Wow, fast response.

Is there a way to rename "Form1" without having to change code (like I
have been doing), or is "Form1" in the code as soon as the user starts
a new project?

I thought the .cs file name and the name in the (name) section in form
properties should match, but need they?


the .cs file can be named whatever you want and doesnt have to
correspond to the name in the project (doesnt matter in code)

As soon as you start a winforms app, it adds form1 and sets that as the
startup form.
You can set the startup object using
project properties >> general >> startup object
but that doesnt seem to rename the main so I dont know what that
actually does.

You should only need to do this for the first form and it shouldnt be a
problem.

Cheers
JB
Nov 16 '05 #4
Hello, Tim923!

I faced that problem before, and what I did was just delete the old
form from the project (perhaps from the disk, as you don't need it,
the project manager "on the right" can do it for you) and create a
new one with the desired name...

Hope that helps.

You wrote on Mon, 13 Sep 2004 23:46:55 GMT:

T> I rename "Form1.cs" on the right to the desired name, and also go into
T> properties of the form and name it in the (name) section. After
T> building, Form1.cs appears in the code and gives an error. I was told
T> not to double-click anything, but it still happened. How to fix?

With best regards, Nurchi BECHED.
Nov 16 '05 #5

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

Similar topics

10
8210
by: Clint | last post by:
Hey all - I'm having a really confusing problem concerning a web service. Right now, I have an application that needs to call a web service that does nothing but return "true" (this will obviously change once the program's fully built to actually do something, but for testing, it works). The only code I added to the service is below:
3
2918
by: Boki | last post by:
Dear All, I think you all knew my problem. I don't know how to draw line @@ in VB.NET (2005 beta) , very sad. Coudl you please help me? Best regards, Boki.
1
1870
by: Carla Simeoni | last post by:
I would like to write seomthing into the title bar of the current Form "Form1". How can I do this ? How can I display/add a status bar (currently there is no such status bar) and write something into this status bar? Carla
1
1689
by: Peter Hann | last post by:
What si the easiest way to switch from the source of a Form to its corrsponding Design and vice versa back ? Currently I always click on the file in the Solutions explorer. Is there way way with HotKeys ? Peter
5
10809
by: Nathan Sokalski | last post by:
I have an ASP.NET application which is giving the following JavaScript error: 'theForm' is undefined However, when I do a View Source one of the <scriptelements is as follows: <script type="text/javascript"> <!-- var theForm = document.forms;
1
3210
by: zaidalin79 | last post by:
I am in a JavaScript class, and we have to get all of our code to validate at the w3c website... Here is my code, it does what I want it to do which is require the user to enter the name and either the address of the email address, but when I try to validate it through w3c, I get the following errors... Can anyone help? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
8
8261
by: webandwe | last post by:
Hi, I have to radio buttons and depending on the selection it must eighter insert step2.php or insert.php in the action part of the form. Now it's just going to steo2.php I also tried elseif ($rado="no") but thats giving the same problem. Thans
3
1921
by: eBob.com | last post by:
How does a "sub-form", i.e. one invoked by another form, determine anything about the form which brought it into existence, i.e., I suppose, instantiated it? I wanted to so something like this ... MsgBox("called by " & Owner.Name) .... but that throws a null reference exception. Parent.Name and ParentForm.Name also throw null reference exceptions. Form1.Name works - but that's not very flexible.
2
4312
by: bips2008 | last post by:
The code seems to work fine in other browser but in IE it throws this error. This is very urgent for me and any help would be greatly appreciated For your convienence i have posted the code for the file. The portion that is not working is the star rating part <?php session_start(); include_once('includes/host_conf.php'); include_once('includes/db_connect.php'); include_once('includes/mysql.lib.php');...
0
9683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9054
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6792
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5443
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.