如何指定要首先运行的特定Windows窗体 [英] how to specify a particular windows form to run at first

查看:62
本文介绍了如何指定要首先运行的特定Windows窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多种形式的项目.我想从那个项目运行一个特定的表单,这没有发生.来自同一项目的另一种形式首先会开始,我不想这样做.
我正在使用Visual Studio Ultimate. 2010.有人可以帮我吗plz

解决方案

转到项目"program.cs",并在行中更改表单名称,如下所示:

 静态  class 程序
    {
        // < summary> 
        // 应用程序的主要入口点.
        // </summary> 
        [STAThread]
        静态 无效 Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault( false );
            Application.Run( Form1()); // < --------在此处更改
        }
    } 


i have a project which consist of many forms. I want to run a particular form from a that project, which is not happening. An another form from the same project starts at first which i dont want to.
I am using visual studio ultimate. 2010. Can any one help me plz

解决方案

Go to the projects "program.cs" and change the form name in the line like the following :

static class Program
    {
        // <summary>
        // The main entry point for the application.
        // </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1()); // <-------- change here
        }
    }


这篇关于如何指定要首先运行的特定Windows窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆