同时将值program.cs传递给另一种形式

编程入门 行业动态 更新时间:2024-10-26 07:31:09
本文介绍了同时将值program.cs传递给另一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家 在这里,我的问题是我想将像字符串这样的值从program.cs传递给form1.cs (form1是启动屏幕). 可以同时将值从program.cs传递到form1.cs. 注意:即使我想显示来自program.cs的状态,我也要运行form1.

Hi, all Here my problem is i want to pass value like string from program.cs to form1.cs (form1 is splash screen). it possible to simultaneously pass value from program.cs to form1.cs. Note: i want run form1 even though i want to show status from program.cs, it possible.

推荐答案

是的-但这不是正常"的的方法. program.cs通常是一个非常基础的启动程序,它将构造Application对象并将其附加到表单-当该表单关闭时,Application也会关闭. 您似乎正在做的是尝试使启动屏幕显示应用程序启动的进度-至少需要两个线程-然后移至主"应用程序. 看一下: C#中的漂亮启动画面 [ ^ ]-它可以帮助您减轻痛苦. Yes - but that''s not the "normal" way to do it. program.cs is normally a very basic startup which constructs the Application object and attaches a form to it - when that form closes, so does the Application. What you appear to be doing is trying to get a splash screen to show the progress of your app startup - which requires a minimum of two threads - and then move into the "main" application. Have a look at this: A Pretty Good Splash Screen in C#[^] - it should help take the pain out of what you are trying to do.

更多推荐

同时将值program.cs传递给另一种形式

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

发布评论

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

>www.elefans.com

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