同时将值program.cs传递给另一种形式 [英] simultaneously pass value program.cs to another form

查看:112
本文介绍了同时将值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传递给另一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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