473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fals e);

Application.Run(new frmIMOptions());

Nov 6 '06 #1
11 7630
"Toby" <to**@notreal.comwrote in message
news:uJ**************@TK2MSFTNGP02.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.comwrote:
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.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fals e);

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.cs")

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.comwrote in message
news:uJ**************@TK2MSFTNGP02.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.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fals e);

Application.Run(new frmIMOptions());

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

Sorry about that
"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote in message
news:12*************@corp.supernews.com...
"Toby" <to**@notreal.comwrote in message
news:uJ**************@TK2MSFTNGP02.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.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.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.comwrote:
>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.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fal se);

Application.Run(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.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.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.comwrote:
>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.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fal se);

Application.Run(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 "frmIMOptions" 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.cs") and find the
namespace:

namespace ThisIsYourProject.AndThisIsASubNamespace
{
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.comwrote in message
news:OV**************@TK2MSFTNGP03.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.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.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.comwrote:
>>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.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fa lse);

Application.Run(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*************@TK2MSFTNGP04.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 "frmIMOptions" 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.cs")
and find the namespace:

namespace ThisIsYourProject.AndThisIsASubNamespace
{
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.comwrote in message
news:OV**************@TK2MSFTNGP03.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.comwrote in message
news:11*********************@i42g2000cwa.googlegr oups.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.comwrote:
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.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(f alse);

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 "frmIMOptions" 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.comwrote in message
news:ux****************@TK2MSFTNGP04.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*************@TK2MSFTNGP04.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 "frmIMOptions" 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.cs")
and find the namespace:

namespace ThisIsYourProject.AndThisIsASubNamespace
{
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.comwrote in message
news:OV**************@TK2MSFTNGP03.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.comwrote in message
news:11*********************@i42g2000cwa.googleg roups.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.comwrote:
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.EnableVisualStyles();
>
Application.SetCompatibleTextRenderingDefault( false);
>
Application.Run(new frmIMOptions());



Nov 6 '06 #10
Dave,
what would be a good book to get to really get started with c#? I have
been programming in VB6 for a while now so some of the concepts are
formulary but the syntax is killing me.
Toby
"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:eH*************@TK2MSFTNGP04.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 "frmIMOptions" 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.cs")
and find the namespace:

namespace ThisIsYourProject.AndThisIsASubNamespace
{
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.comwrote in message
news:OV**************@TK2MSFTNGP03.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.comwrote in message
news:11*********************@i42g2000cwa.googlegr oups.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.comwrote:
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.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(f alse);

Application.Run(new frmIMOptions());



Nov 6 '06 #11
Hi Toby,

I'm sorry but I don't know of any good books to recommend. Hopefully someone
else will fill in the blanks there :)

There are, of course, a lot of refences on the web that could be an enormous
help to you. To name a few:

"C# Language Reference"
http://msdn2.microsoft.com/en-us/lib...y6(VS.80).aspx

"C# Programming Guide"
http://msdn2.microsoft.com/en-us/lib...bd(VS.80).aspx

"Writing Applications with C#"
http://msdn2.microsoft.com/en-us/lib...81(VS.80).aspx

Look at the TOC and you'll see many more topics that may interest you. There
are many references other than MSDN, of course, but I've only included these
because they contain enough information to keep you busy for at least a few
hours ;)

--
Dave Sexton

"Toby" <to**@notreal.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Dave,
what would be a good book to get to really get started with c#? I have
been programming in VB6 for a while now so some of the concepts are
formulary but the syntax is killing me.
Toby
"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:eH*************@TK2MSFTNGP04.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 "frmIMOptions" 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.cs")
and find the namespace:

namespace ThisIsYourProject.AndThisIsASubNamespace
{
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.comwrote in message
news:OV**************@TK2MSFTNGP03.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.comwrote in message
news:11*********************@i42g2000cwa.googleg roups.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.comwrote:
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.EnableVisualStyles();
>
Application.SetCompatibleTextRenderingDefault( false);
>
Application.Run(new frmIMOptions());



Nov 6 '06 #12

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

Similar topics

4
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...
1
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...
10
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
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
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 =...
1
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...
6
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...
0
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.