问:线程和东西 [英] Q: Threads and stuff

查看:53
本文介绍了问:线程和东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




有人可以帮助我吗?


我有一个主应用程序,为了参数Form1而调用,

将成为我的应用程序代码的主要来源。我一直试图在主应用程序出现之前显示一个启动画面,即

Form1。这个启动画面我将打电话给Form2。


所以,我要做的是启动应用程序,显示Form2然后

时它关闭,显示主窗体,即Form1。


我已经在网上搜索过,发现了一些好主意但是有点像新手b
新手在VB我有点挣扎,我做的很多都是猜测。


有人可以给我一些建议吗?


Geoff

Hi

Can anybody help me with the following?

I have a main application, called for the sake of argument Form1, which is
going to be the main source of my application code. I''ve been trying to
develop a splash screen to appear before the main application appears i.e.
Form1. This splash screen I am going to call Form2.

So, what I''m trying to do is start the application, display Form2 and then
when it closes, display the main form i.e. Form1.

I''ve searched the web and found a few bright ideas but being a bit of a
novice in VB I''m struggling a bit and a lot of what I''ve done is guesswork.

Could anybody give me some suggestions?

Geoff

推荐答案

Geoff,


最简单的就是* load * event of mainform(在负载

事件中表格尚未显示)


dim frm as new form2

dim frm2.showdialog

frm2.dispose


而不是在你的form2中设置一个按实例运行10次的计时器

用10减少10次不透明度,当它完成10次(或不透明度为0 b $ b)时,在那个定时器中说甚至但是,接下来我很高兴看到你的程序当然等待你的

启动画面准备好了。


当你没有真正重要的处理开始时无关紧要,

因为显示1秒是没有什么,而1秒内大部分是每个创业公司

过程是由一台现代计算机完成的,当你想要避免使用多线程时你可以使用多线程,但是当它为1

秒时我发现很多工作。


我希望这能给出一些想法,什么时候可以随意询问?


Cor


Geoff Jones < no ******** @ email.com>
Geoff,

The most simple one is in the *load* event of your mainform (in the load
event the form is not yet showed)

dim frm as new form2
dim frm2.showdialog
frm2.dispose

And than set in your form2 a timer which runs by instance 10 times
decreasing the opacity ten times with 10 and when it is done 10 times (or
the opacity is 0) say in that timer event me.close

Looks greath however in this way your program is of course waiting for your
splash screen to be ready.

When you have not really big start in processing that does not matter,
because 1 second to show is nothing while in 1 second mostly every startup
process is done by a modern computer, when you want to avoid that you can
use multithreading, however I find that a lot of work when it is for 1
second.

I hope this gives some ideas and when not feel free to ask?

Cor

"Geoff Jones" <no********@email.com>


任何人都可以帮我解决以下问题吗?

我有一个主要的应用程序,为了参数Form1而调用,它将成为我的应用程序代码的主要来源。我一直试图在主应用程序出现之前开发一个启动画面,即
Form1。这个启动画面我将打电话给Form2。

所以,我要做的是启动应用程序,显示Form2然后
当它关闭时,显示主窗体即ie Form1。

我已经在网上搜索并找到了一些好主意,但在VB中有点像新手我正在努力一点点而且很多我在做什么已经完成了
猜测。

有人可以给我一些建议吗?

Geoff
Hi

Can anybody help me with the following?

I have a main application, called for the sake of argument Form1, which is
going to be the main source of my application code. I''ve been trying to
develop a splash screen to appear before the main application appears i.e.
Form1. This splash screen I am going to call Form2.

So, what I''m trying to do is start the application, display Form2 and then
when it closes, display the main form i.e. Form1.

I''ve searched the web and found a few bright ideas but being a bit of a
novice in VB I''m struggling a bit and a lot of what I''ve done is
guesswork.

Could anybody give me some suggestions?

Geoff



谢谢Cor。


除了在Form1之前出现的Form2之外还有效。是否有工作区

那个?


顺便说一下,为什么这不起作用:


dim frm as new form2

frm2.show''即使用show()而不是showdialog()

frm2.dispose


Geoff


" Cor Ligthert" <无************ @ planet.nl>在消息中写道

news:e6 ************** @ tk2msftngp13.phx.gbl ...
Thanks Cor.

That works apart from Form2 appearing before Form1. Is there workround for
that?

By the way, why does this not work for:

dim frm as new form2
frm2.show '' i.e. use show() instead of showdialog()
frm2.dispose

Geoff

"Cor Ligthert" <no************@planet.nl> wrote in message
news:e6**************@tk2msftngp13.phx.gbl...
Geoff,
最简单的一个是在你的mainform的* load *事件中(在负载
事件中表单尚未显示)

dim frm as new form2
frm2.dispose

然后在你的form2中设置一个计时器,它按实例运行10次
将10次不透明度降低10次,当它是完成10次(或不透明度为0)在那个计时器事件中说me.close

看起来很好,但是这样你的程序当然在等待你的启动画面准备就绪。

当你没有真正重要的处理开始并不重要时,
因为1秒钟显示什么都没有,而1秒内大部分都是每个创业公司
过程是由现代计算机完成,当你想避免使用多线程时,我发现它的工作时间很长。

我希望这能给出一些想法,什么时候不要随意问?

Geoff Jones < no ******** @ email.com>
Geoff,

The most simple one is in the *load* event of your mainform (in the load
event the form is not yet showed)

dim frm as new form2
dim frm2.showdialog
frm2.dispose

And than set in your form2 a timer which runs by instance 10 times
decreasing the opacity ten times with 10 and when it is done 10 times (or
the opacity is 0) say in that timer event me.close

Looks greath however in this way your program is of course waiting for
your splash screen to be ready.

When you have not really big start in processing that does not matter,
because 1 second to show is nothing while in 1 second mostly every startup
process is done by a modern computer, when you want to avoid that you can
use multithreading, however I find that a lot of work when it is for 1
second.

I hope this gives some ideas and when not feel free to ask?

Cor

"Geoff Jones" <no********@email.com>


任何人都可以帮我解决以下问题吗?

我有一个主要的应用程序,为了参数Form1而调用,它将成为我的应用程序代码的主要来源。我一直在尝试开发一个启动画面,以便在主应用程序出现之前出现
即Form1。这个启动画面我将打电话给Form2。

所以,我要做的是启动应用程序,显示Form2和
然后当它关闭时,显示主窗体即ie Form1。

我已经在网上搜索并找到了一些好主意,但在VB中有点像新手我正在努力一点点而且很多我在做什么已经完成了
猜测。

有人可以给我一些建议吗?

Geoff
Hi

Can anybody help me with the following?

I have a main application, called for the sake of argument Form1, which
is going to be the main source of my application code. I''ve been trying
to develop a splash screen to appear before the main application appears
i.e. Form1. This splash screen I am going to call Form2.

So, what I''m trying to do is start the application, display Form2 and
then when it closes, display the main form i.e. Form1.

I''ve searched the web and found a few bright ideas but being a bit of a
novice in VB I''m struggling a bit and a lot of what I''ve done is
guesswork.

Could anybody give me some suggestions?

Geoff




Geoff,


请告诉我下面我不明白的东西?


您的问题
Geoff,

Please tell me what I don''t understand beneath?

Your question
我一直在尝试开发一个启动画面,以便在主要
应用程序出现之前出现,即Form1。


您对我的解决方案的回答除了在Form1之前出现的Form2之外还有其他工作。
有工作吗?
dim frm as new form2
frm2.show''即使用show()而不是showdialog()
frm2.dispose

可能这个有用但是你的眼睛没法见到那个frm2。


:-)


Cor


" Cor Ligthert <无************ @ planet.nl>在消息中写道
新闻:e6 ************** @ tk2msftngp13.phx.gbl ...
I''ve been trying to develop a splash screen to appear before the main
application appears i.e. Form1.
Your answer on my solution That works apart from Form2 appearing before Form1. Is there workround for
that? dim frm as new form2
frm2.show '' i.e. use show() instead of showdialog()
frm2.dispose
Probably this works however are your eyes not fast enough to see that frm2.

:-)

Cor


"Cor Ligthert" <no************@planet.nl> wrote in message
news:e6**************@tk2msftngp13.phx.gbl...
Geoff,
最简单的一个是在你的mainform的* load *事件中(在负载
事件中表单尚未显示)

dim frm as new form2
dim frm2 .showdialog
frm2.dispose

然后在你的form2中设置一个计时器,按实例运行10次
将10次不透明度降低10次,当它完成10次时(或者说不透明度是0)在那个计时器事件中说me.close

看起来很好,但是这样你的程序当然在等待你的启动画面准备就绪。

当你没有真正重要的处理开始并不重要时,
因为1秒显示没有什么,而在1秒内大多数每个启动过程都是由现代的电脑,当你想要避免那种
你可以使用多线程时,但是我发现很多工作时间为1秒钟。

我跳这给了一些想法,什么时候不要随意问?

Geoff Jones < no ******** @ email.com>
Geoff,

The most simple one is in the *load* event of your mainform (in the load
event the form is not yet showed)

dim frm as new form2
dim frm2.showdialog
frm2.dispose

And than set in your form2 a timer which runs by instance 10 times
decreasing the opacity ten times with 10 and when it is done 10 times (or
the opacity is 0) say in that timer event me.close

Looks greath however in this way your program is of course waiting for
your splash screen to be ready.

When you have not really big start in processing that does not matter,
because 1 second to show is nothing while in 1 second mostly every
startup process is done by a modern computer, when you want to avoid that
you can use multithreading, however I find that a lot of work when it is
for 1 second.

I hope this gives some ideas and when not feel free to ask?

Cor

"Geoff Jones" <no********@email.com>


任何人都可以帮我解决以下问题吗?

我有一个主要的应用程序,为了参数Form1而调用,它将成为我的应用程序代码的主要来源。我一直在尝试开发一个启动画面,以便在主应用程序出现之前出现
即Form1。这个启动画面我将打电话给Form2。

所以,我要做的是启动应用程序,显示Form2和
然后当它关闭时,显示主窗体即ie Form1。

我已经在网上搜索并找到了一些好主意,但在VB中有点像新手我正在努力一点点而且很多我在做什么已经完成了
猜测。

有人可以给我一些建议吗?

Geoff
Hi

Can anybody help me with the following?

I have a main application, called for the sake of argument Form1, which
is going to be the main source of my application code. I''ve been trying
to develop a splash screen to appear before the main application appears
i.e. Form1. This splash screen I am going to call Form2.

So, what I''m trying to do is start the application, display Form2 and
then when it closes, display the main form i.e. Form1.

I''ve searched the web and found a few bright ideas but being a bit of a
novice in VB I''m struggling a bit and a lot of what I''ve done is
guesswork.

Could anybody give me some suggestions?

Geoff





这篇关于问:线程和东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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