如何更改默认表单以使用写入代码在C#中运行 [英] How I Can Change Default Form To Run In C# With Write Code

查看:62
本文介绍了如何更改默认表单以使用写入代码在C#中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有

i设计了一个在首次运行中有步骤的软件。

在首次运行的软件中获取系统的基本信息,我想不显示此表格接下来我可以运行什么?

请帮助我谢谢。

hi all
i designed a software that have steps in first run.
in first run software take a base information of system and i want to dont show this form in next runs what i can ?
pls help me thanks.

推荐答案

Yes easily you can do this. by modifying 'Program.cs' of your Application I guess your project is C# windows form Application.However I am giving you a sample and mentioning where to modify 







    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());  
//Here Form1 is the default Form you can change say you want to set Login form as //default just change Form1 to Login like below
           //Application.Run(new Login());

        }
    }







Here Form1 is the default Form you can change say you want to set Form2 form as default just change Form1 to Form2 as mentioned above.Happy Coding


这篇关于如何更改默认表单以使用写入代码在C#中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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