473,586 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing the start up form

I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying to go
back and change the start up form and it is giving me errors when I change
the form name that is below. And help on this would be nice..

Application.Ena bleVisualStyles ();

Application.Set CompatibleTextR enderingDefault (false);

Application.Run (new frmIMOptions()) ;

Nov 6 '06 #1
11 7659
"Toby" <to**@notreal.c omwrote in message
news:uJ******** ******@TK2MSFTN GP02.phx.gbl...
>I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying to
go back and change the start up form and it is giving me errors when I
change the form name that is below. And help on this would be nice..
If you don't tell us what errors you're getting, there's no way for anyone
to suggest anything about how to fix them.
Nov 6 '06 #2
V
Hmm... do you have a keyword public in front of the class declaration
for whichever form you are changing it to?

Or you can try moving the Main method to the form that you want to load
at startup and change the name of the form in Application.Run after
moving it.

Regards,
Vaibhav

On Nov 7, 12:14 am, "Toby" <t...@notreal.c omwrote:
I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying to go
back and change the start up form and it is giving me errors when I change
the form name that is below. And help on this would be nice..

Application.Ena bleVisualStyles ();

Application.Set CompatibleTextR enderingDefault (false);

Application.Run (new frmIMOptions()) ;
Nov 6 '06 #3
Hi Toby,

What is the exact error message?

Can you confirm that frmIMOptions is a class in your project that derives from
Form?

Example:

class frmIMOptions : Form
{
}

(probably located in a file named, "frmIMOptions.c s")

Can you confirm that either:

A. The namespace of the class that contains your Main method is the same as
the namespace of the frmIMOptions class

B. Otherwise, the compiler may require a "using [namespace]" statement in the
file that contains your Main method to scope frmIMOptions

--
Dave Sexton

"Toby" <to**@notreal.c omwrote in message
news:uJ******** ******@TK2MSFTN GP02.phx.gbl...
>I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying to go
back and change the start up form and it is giving me errors when I change
the form name that is below. And help on this would be nice..

Application.Ena bleVisualStyles ();

Application.Set CompatibleTextR enderingDefault (false);

Application.Run (new frmIMOptions()) ;

Nov 6 '06 #4
Error 1 The type or namespace name 'frmIMAddOption s' could not be found (are
you missing a using directive or an assembly reference?) C:\ \ \ \My
Documents\Visua l Studio 2005\Projects\O ptions Tool\Options Tool\Program.cs
17 33 Options Tool

Sorry about that
"Peter Duniho" <Np*********@Nn OwSlPiAnMk.comw rote in message
news:12******** *****@corp.supe rnews.com...
"Toby" <to**@notreal.c omwrote in message
news:uJ******** ******@TK2MSFTN GP02.phx.gbl...
>>I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying to
go back and change the start up form and it is giving me errors when I
change the form name that is below. And help on this would be nice..

If you don't tell us what errors you're getting, there's no way for anyone
to suggest anything about how to fix them.

Nov 6 '06 #5
The static void Main() is in the Program.cs.
That is is where VS put it. Can I move that?
"V" <va************ *@gmail.comwrot e in message
news:11******** *************@i 42g2000cwa.goog legroups.com...
Hmm... do you have a keyword public in front of the class declaration
for whichever form you are changing it to?

Or you can try moving the Main method to the form that you want to load
at startup and change the name of the form in Application.Run after
moving it.

Regards,
Vaibhav

On Nov 7, 12:14 am, "Toby" <t...@notreal.c omwrote:
>I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying to
go
back and change the start up form and it is giving me errors when I
change
the form name that is below. And help on this would be nice..

Application.En ableVisualStyle s();

Application.Se tCompatibleText RenderingDefaul t(false);

Application.Ru n(new frmIMOptions()) ;

Nov 6 '06 #6
Ok I moved it from the program.cs to the form I wanted as a start up and
that works. I thank you all for the help. I am sure I will be back soon with
more questions.
"V" <va************ *@gmail.comwrot e in message
news:11******** *************@i 42g2000cwa.goog legroups.com...
Hmm... do you have a keyword public in front of the class declaration
for whichever form you are changing it to?

Or you can try moving the Main method to the form that you want to load
at startup and change the name of the form in Application.Run after
moving it.

Regards,
Vaibhav

On Nov 7, 12:14 am, "Toby" <t...@notreal.c omwrote:
>I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying to
go
back and change the start up form and it is giving me errors when I
change
the form name that is below. And help on this would be nice..

Application.En ableVisualStyle s();

Application.Se tCompatibleText RenderingDefaul t(false);

Application.Ru n(new frmIMOptions()) ;

Nov 6 '06 #7
Hi Toby,

I don't recommend moving the Main method from the Program file.

Instead, include the frmIMOptions's namespace into the Main method's scope.
You can do this quite easily in VS 2005:

1. Place the cursor over "frmIMOptio ns" in the following line:
>>Application.R un(new frmIMOptions()) ;
A red box should appear under the "s".

2. Hover the mouse over the red box
3. Click the drop-down array that appears
4. Select the "using" item that has the appropriate namespace for your class

To find out the namespace that frmIMOptions is in, open the file that contains
the frmIMOptions class in code view (probably "frmIMOptions.c s") and find the
namespace:

namespace ThisIsYourProje ct.AndThisIsASu bNamespace
{
public class frmIMOptions : Form
{
...
}
}

Let us know if you don't see the red box, the drop-down or the appropriate
namespace in the list

--
Dave Sexton

"Toby" <to**@notreal.c omwrote in message
news:OV******** ******@TK2MSFTN GP03.phx.gbl...
The static void Main() is in the Program.cs.
That is is where VS put it. Can I move that?
"V" <va************ *@gmail.comwrot e in message
news:11******** *************@i 42g2000cwa.goog legroups.com...
>Hmm... do you have a keyword public in front of the class declaration
for whichever form you are changing it to?

Or you can try moving the Main method to the form that you want to load
at startup and change the name of the form in Application.Run after
moving it.

Regards,
Vaibhav

On Nov 7, 12:14 am, "Toby" <t...@notreal.c omwrote:
>>I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying to
go
back and change the start up form and it is giving me errors when I change
the form name that is below. And help on this would be nice..

Application.E nableVisualStyl es();

Application.S etCompatibleTex tRenderingDefau lt(false);

Application.R un(new frmIMOptions()) ;


Nov 6 '06 #8
I moved it back and did what you said and wow it works.. Thank you

"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:eH******** *****@TK2MSFTNG P04.phx.gbl...
Hi Toby,

I don't recommend moving the Main method from the Program file.

Instead, include the frmIMOptions's namespace into the Main method's
scope. You can do this quite easily in VS 2005:

1. Place the cursor over "frmIMOptio ns" in the following line:
>>>Application. Run(new frmIMOptions()) ;

A red box should appear under the "s".

2. Hover the mouse over the red box
3. Click the drop-down array that appears
4. Select the "using" item that has the appropriate namespace for your
class

To find out the namespace that frmIMOptions is in, open the file that
contains the frmIMOptions class in code view (probably "frmIMOptions.c s")
and find the namespace:

namespace ThisIsYourProje ct.AndThisIsASu bNamespace
{
public class frmIMOptions : Form
{
...
}
}

Let us know if you don't see the red box, the drop-down or the appropriate
namespace in the list

--
Dave Sexton

"Toby" <to**@notreal.c omwrote in message
news:OV******** ******@TK2MSFTN GP03.phx.gbl...
>The static void Main() is in the Program.cs.
That is is where VS put it. Can I move that?
"V" <va************ *@gmail.comwrot e in message
news:11******* **************@ i42g2000cwa.goo glegroups.com.. .
>>Hmm... do you have a keyword public in front of the class declaration
for whichever form you are changing it to?

Or you can try moving the Main method to the form that you want to load
at startup and change the name of the form in Application.Run after
moving it.

Regards,
Vaibhav

On Nov 7, 12:14 am, "Toby" <t...@notreal.c omwrote:
I am a little new as you can tell by this post.

This is my first c# window app and I made all my forms and now trying
to go
back and change the start up form and it is giving me errors when I
change
the form name that is below. And help on this would be nice..

Application. EnableVisualSty les();

Application. SetCompatibleTe xtRenderingDefa ult(false);

Application. Run(new frmIMOptions()) ;



Nov 6 '06 #9
Hi Toby,

If you look at the top of the file that contains the Main method you'll now
see a "using" statement that provides the namespace of the frmIMOptions Form.
This statement tells the compiler where to look to resolve unqualified
references to the "frmIMOptio ns" token.

You could have added this yourself, manually, although it's usually quicker to
just allow VS to do it for you (this feature is new to VS 2005).

HTH

--
Dave Sexton

"Toby" <to**@notreal.c omwrote in message
news:ux******** ********@TK2MSF TNGP04.phx.gbl. ..
>I moved it back and did what you said and wow it works.. Thank you

"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:eH******** *****@TK2MSFTNG P04.phx.gbl...
>Hi Toby,

I don't recommend moving the Main method from the Program file.

Instead, include the frmIMOptions's namespace into the Main method's scope.
You can do this quite easily in VS 2005:

1. Place the cursor over "frmIMOptio ns" in the following line:
>>>>Application .Run(new frmIMOptions()) ;

A red box should appear under the "s".

2. Hover the mouse over the red box
3. Click the drop-down array that appears
4. Select the "using" item that has the appropriate namespace for your
class

To find out the namespace that frmIMOptions is in, open the file that
contains the frmIMOptions class in code view (probably "frmIMOptions.c s")
and find the namespace:

namespace ThisIsYourProje ct.AndThisIsASu bNamespace
{
public class frmIMOptions : Form
{
...
}
}

Let us know if you don't see the red box, the drop-down or the appropriate
namespace in the list

--
Dave Sexton

"Toby" <to**@notreal.c omwrote in message
news:OV******* *******@TK2MSFT NGP03.phx.gbl.. .
>>The static void Main() is in the Program.cs.
That is is where VS put it. Can I move that?
"V" <va************ *@gmail.comwrot e in message
news:11****** *************** @i42g2000cwa.go oglegroups.com. ..
Hmm... do you have a keyword public in front of the class declaration
for whichever form you are changing it to?

Or you can try moving the Main method to the form that you want to load
at startup and change the name of the form in Application.Run after
moving it.

Regards,
Vaibhav

On Nov 7, 12:14 am, "Toby" <t...@notreal.c omwrote:
I am a little new as you can tell by this post.
>
This is my first c# window app and I made all my forms and now trying to
go
back and change the start up form and it is giving me errors when I
change
the form name that is below. And help on this would be nice..
>
Application .EnableVisualSt yles();
>
Application .SetCompatibleT extRenderingDef ault(false);
>
Application .Run(new frmIMOptions()) ;



Nov 6 '06 #10

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

Similar topics

4
1923
by: Brad Jones | last post by:
<Previously posted in microsoft.public.dotnet.framework.windowsforms> Hi all. Any suggestions here would be appreciated. Thanks for reading. I'm primarly a C++ developer but I've been trying to complete development on a C# application with the following basic requirements: - The app runs in the background is initially hidden from the user,...
1
3049
by: Max Harvey | last post by:
Hi, I made up a nice little form which had its own sub form in it. I made a litle VB code so that when I pressed a button it would move form the form (frmConference) to the subform (frmBookingBookingBased), start a new record, and copy some values form the form into some fields in the subform, and then leave the cursor sitting (in...
10
15351
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 identical field names. The queries select a subset of the fields, so "Select *" is not really an option. Is there an easy way to change the source...
5
2939
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 in the associated table that this form is based on. Is there anyway I can do this with vba ? I am using a different button object to open this form...
4
4533
by: cashdeskmac | last post by:
I have a string which has been assigned the value of "OneTwoThree". I have created a property because I want to be able to assign a new value to this string. I have: string numbers = "OneTwoThree"; public string StringToCompare {
1
1337
by: K.N.Ranjit | last post by:
Hi to all friends out there.I am presently working in TCS and I am supposed to do the work given to me in line cordinates using VB.net.But over here I face a problem (ie) I want my coordinate (0,0) to start in the lower-left corner of my form instead of the default upper-left corner of the form.If anyone could provide me the solution I would...
6
7105
by: andreas | last post by:
A selected text has fontstyles like bold and italic and underscore I want to remove one of them without changing the other fontstyles. How to do that? Thanks for any response
2
3103
by: austinra | last post by:
i have a splash screen that i want to change a picture once a second for three seconds; then load my main form. what i want it to do is load a picture into a picture box; start a timer which will stop the loop for one second then start the loop again add 1 to the pintcount which will result in the name of aneither picture (my pictures are named 1,...
0
7841
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8204
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. ...
0
8339
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...
1
7965
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...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
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...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1184
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...

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.