如何编译和运行当前打开的表单 [英] How to compile and Run current open form

查看:46
本文介绍了如何编译和运行当前打开的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

在Visual Studio 2017社区中,如何编译和运行当前表单是否有任何快捷键? ,我不想每次在Program.cs文件中更改static void Main()

        {

            Application.EnableVisualStyles();

            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new Login());
$
        }

in Visual Studio 2017 Community , how to compile and run only current form is there any shortcut key for this ? , I don't want to change every time in Program.cs file static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Login());
        }

我只想使用快捷键来运行当前表单。例如(Shift + F5或任何捷径)请。

I only want to RUN current form by using shortcut key. e.g (Shift+F5 or any shortcut) please.

推荐答案

你好,

是这个项目有多种形式,例如登录,Form1等?

Are there multiple forms in this project e.g. Login, Form1 etc ?

假设你有两个表单,login和form1,并在解决方案资源管理器中选择了form1,但在Program.cs中有登录,如图所示。如果不更改program.cs中的代码,就无法将form1作为启动表单。 

Let's say you have two forms, login and form1 and have form1 selected in solution explorer but in Program.cs have login as shown. There is no way to have form1 be the startup form without changing code in program.cs. 

如果我误解了你的问题,我很抱歉。

If I have misinterpreted your question my apologies.


这篇关于如何编译和运行当前打开的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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