|
-
Jun 14th, 2007, 08:59 AM
#1
Thread Starter
Fanatic Member
Wait for return value
I have a form and what it does right now is when the user clicks the add button, a second form opens asking for how many copies. When the user chooses a number and clicks the button on that form it closes and returns a value. But in the sub that calls the second form, I want it to now continue with the code until the second form has closed and a value has returned so I can use the value in the code after. Is this possilble?
Last edited by Beast777; Jun 18th, 2007 at 01:06 PM.
-
Jun 14th, 2007, 01:45 PM
#2
Re: Wait for return value
Show the popup form using ShowDialog() and it will block the calling method until the form is closed (set its DialogResult property to indicate the returned value, or add your own property).
-
Jun 14th, 2007, 02:05 PM
#3
Addicted Member
Re: Wait for return value
penagate is right. Here is a link to a thread where I asked a similar question and there is some example code...
http://www.vbforums.com/showthread.php?t=470000
-
Jun 15th, 2007, 04:36 AM
#4
Re: Wait for return value
I want it to now continue with the code until the second form has closed and a value has returned so I can use the value in the code after
That can't happen if I understood correctly
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 15th, 2007, 07:40 AM
#5
Re: Wait for return value
I think the OP meant "not" rather than "now".
-
Jun 18th, 2007, 07:04 AM
#6
Thread Starter
Fanatic Member
Re: Wait for return value
Yes sorry not is correct. Thank you all for the posts.
-
Jun 18th, 2007, 01:05 PM
#7
Thread Starter
Fanatic Member
Re: [RESOLVED] Wait for return value
Can you have a showdialog to open a new form, and within it also have another showdialog? I cannot seem to get it to work.
-
Jun 21st, 2007, 10:03 AM
#8
Re: Wait for return value
Yeah you can. Pretty straightforward. Show your code, you might be doing something wrong. And you might be getting an error. And it might be helpful if you told us what the error is
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
|