Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

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
0
muskad202
Asked:
muskad202
  • 2
1 Solution
 
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now