pausing execution on form display

hi !!
my project type is console (a compulsion) ..
in the main function, i need the execution to go like this :

FormX = new Form(); //windows form

//some lines

//Display FormX, and pause execution till the user presses the "Continue" button on the form.

//execute some more lines

//again display the FormX ..

----

at present, when the form needs to be displayed, i'm using FormX.ShowDialog() .. but, then to continue, the user has to click the 'X' button (to close the form), and then, the next time i want to display it, i again call ShowDialg() ..is there any way that execution can continue without closing the form (i.e., just pressing a command button on the form - i.e., what should be the code behind such a command button) ..

thanks :)

muskad202
LVL 2
muskad202Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rajaloysiousCommented:
You can use .Show() instead of showdialog
but the execution will immediately return back to the next line

for capturing the continue_clik, you should capture the button click  event of the continue button

cheers
0
muskad202Author Commented:
>>>You can use .Show() instead of showdialog
but the execution will immediately return back to the next line

that is precisely my question, how to prevent the execution from continuing ..

>>>you should capture the button click  event of the continue button

i know .. i was looking for the code to put in the event handler :)
0
rajaloysiousCommented:
>>>>i know .. i was looking for the code to put in the event handler :)
whatever you want to be put in
which says in your first post...
//execute some more lines
this should be put in

>>>that is precisely my question, how to prevent the execution from continuing ..
this is the way show() works
===============
Alternate way
Use .ShowDialog()

And in continue_click
say this.close or this.hide

After this the control will come to you...
cheers
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.