在其他表格之前加载表格

编程入门 行业动态 更新时间:2024-10-05 09:28:43
本文介绍了在其他表格之前加载表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有人可以为此提供帮助吗? 我有一个带有某些控件和代码的Windows窗体应用程序,可以运行.... 当我运行我的项目时,form1将出现.确定. 现在,我创建了第二个表单,用于通过2个文本框和一个按钮来控制用户访问.

does anybody can help about this? i had a windows form application with some controls and code to run...by the way. when i run my project,the form1 will appear.ok. And now i create second form for control user access with 2 text boxes and a button. i want to run form2 before form1 when i run my projct.is it possible?

推荐答案

您需要从表单1的构造函数运行form2或更改什么?是您的项目的启动表单.构造函数不显示表单,需要发生各种事件,如果在构造函数中运行form2,它将首先运行. You need to either run form2 from the constructor of form 1, or change what is the startup form for your project. The constructor does not show the form, various events need to occur, and if you run form2 in the constructor, it will run first.

在program.cs中,更改Application.Run( ...).因此,您可以在入口点[static void Main()] 中处理启动表单. In program.cs, change the Application.Run(...). So you can handle your startup form in entry point [static void Main()] [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1());//here you change your form }

希望有帮助. 欢呼

Hope this help. cheers

就这样.. this is just as it.. public Form1() { InitializeComponent(); Application.Run(new Form2()); }

更多推荐

在其他表格之前加载表格

本文发布于:2023-11-03 04:43:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1554266.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表格   加载

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!