|
-
Oct 11th, 2003, 09:33 AM
#1
Thread Starter
Addicted Member
threading
i have a program that creates two forms , it 2different threads in the sub main, but program execution ends very fast( shows forms for less than a sec , program closed), what can i do about, i dont want to use form.showdialog, any ideas?
-
Oct 11th, 2003, 09:51 AM
#2
Frenzied Member
Post the code you are using.
-
Oct 11th, 2003, 03:35 PM
#3
Thread Starter
Addicted Member
for exampe >>
public sum main()
dim a as new form1
dim b as new form2
a.show
b.show
' ***i want to stop program execution here
end sub
these 2forms are created in 1 thread, not the main thread.
so the Q's are..
1.how to stop program execution after showing forms ( not using form.showdialog )
2.if 1 form has closed , i want the thread to abort
and a 3 q is , when a form is hidden, can it still get and recieve data?
thanks for your time...
-
Oct 12th, 2003, 01:09 AM
#4
Thread Starter
Addicted Member
-
Oct 12th, 2003, 01:30 AM
#5
A couple questions: Why do you want to do this? Why do you not want to use ShowDialog?
Maybe there is another way to do what you want.
-
Oct 12th, 2003, 02:18 AM
#6
Thread Starter
Addicted Member
i have a tcpclient object that connects to a server, on the client there is 2 forms, when a is shown b should be hidden, and when b is shown a should be hidden? both forms get data from the tcpclient
what i'm doing is having the tcpclient in the main thread, then having another thread for the 2 forms
i dont want to use showdialog, because when doing so i had problems when hiding and showing
what do you think? any other better ways?
Last edited by persianboy; Oct 12th, 2003 at 02:22 AM.
-
Oct 12th, 2003, 03:15 AM
#7
So why do the forms have to be on seperate threads? I would make one form showdialog or Application.Run and the other show from it. The should still hide/show fine.
-
Oct 12th, 2003, 03:32 AM
#8
Thread Starter
Addicted Member
so what you mean is have everything in 1 thread,right?!
-
Oct 12th, 2003, 03:33 AM
#9
Yes. I don't understand why you need two threads. you can show and hide with 1 in fact its easier with one.
-
Oct 12th, 2003, 03:52 AM
#10
Thread Starter
Addicted Member
thanks man, i'll start rewriting it in one thread
-
Oct 12th, 2003, 04:13 AM
#11
Thread Starter
Addicted Member
by the way, whats the differance between showdialog and application.run ?!?
thansk for your time....
-
Oct 12th, 2003, 05:24 AM
#12
ShowDialog just shows the form modally, which if used in sub main then this will halt execution until it is closed. Application.Run assigns the form as belonging to the Main or UI thread, which if done in sub main will mean that the entire app will close with the form.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|