更改启动表单 [英] Changing the start up form
问题描述
我在这篇文章中说得有点新鲜了。
这是我的第一个c#窗口应用程序,我制作了所有表格,现在试着去
返回并更改启动表单,当我更改
下面的表单名称时,它会给我错误。对此的帮助会很好..
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new frmIMOptions());
" Toby" < to ** @ notreal.comwrote in message
news:uJ ************** @ TK2MSFTNGP02.phx.gbl ...
< blockquote class =post_quotes>
>我有点新的,你可以通过这篇文章告诉我。
这是我的第一个c#窗口应用程序,我做了我所有的表单,现在尝试返回
返回并更改启动表单,当我更改下面的表单名称时,它会给我错误。这方面的帮助会很好..
如果你不告诉我们你得到了什么错误,那么任何人都没有办法
建议如何修复它们。
嗯...你在类声明前面有一个关键字public吗? >
,无论您将其更改为哪种形式?
或者您可以尝试将Main方法移动到要加载的表单
在启动时,在
移动它后,在Application.Run中更改表单的名称。
问候,
Vaibhav
11月7日上午12:14,托比 < t ... @ notreal.comwrote:
我有点新的,你可以通过这篇文章告诉我们。
这是我的第一个c#窗口应用程序,我制作了所有表格,现在尝试返回
返回并更改启动表单,当我更改时它给了我错误
下面的表单名称。对此的帮助会很好..
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new frmIMOptions());
嗨Toby,
确切的错误信息是什么?
你能否确认frmIMOptions是你项目中的一个类来自
表格?
例如:
class frmIMOptions:表格
{
}
(可能位于名为frmIMOptions.cs的文件中;)
您能否确认:
A.包含Main方法的类的命名空间与
frmIMOptions类的命名空间
B.否则,编译器可能需要using [namespace]。
文件中的声明,其中包含用于范围frmIMOptions的Main方法
-
Dave Sexton
" Toby" < to ** @ notreal.comwrote in message
news:uJ ************** @ TK2MSFTNGP02.phx.gbl ...
< blockquote class =post_quotes>
>我有点新的,你可以通过这篇文章告诉我。
这是我的第一个c#窗口应用程序,我做了我所有的表单,现在试图返回
返回并更改启动表单,当我更改
下面的表单名称时,它会给我错误。对此的帮助会很好..
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new frmIMOptions());
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());
"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.
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());
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());
这篇关于更改启动表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!