Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Forms Help

Status
Not open for further replies.

Webrookie

Programmer
May 18, 2000
112
US
Ok, here's my basic setup:&nbsp;&nbsp;I have a main form which is modal and top level.&nbsp;&nbsp;It controls everything pretty much.&nbsp;&nbsp;When I click a button, the process begins.&nbsp;&nbsp;In a .prg file I want to do another form for user input.&nbsp;&nbsp;That second form is also modal.<br><br>The problem is that when I do the second form, the process continues to run while that form is up, which I don't want.&nbsp;&nbsp;I want the process to wait for the user to click a button to continue.<br><br>I tried to do exactly what the MSDN help said:<br><br>1. Make sure the form is modal.<br>2. In the unload event of the form, return the value you <br>&nbsp;&nbsp;&nbsp;want.<br>3. to call the form: do form #name# to #variable#<br><br>As far as #2 goes, I added a custom property to the form and assign/return that when the user clicks the done button.<br><br>When I run the program, it gets to the point where I have #3 and it says the form must be modal.<br><br>IT IS MODAL...IT COULDN'T BE MORE MODAL!!<br><br>thanks in advance.
 
What's in your unload event of modal form #2?&nbsp;&nbsp;Here's the PEM's:<br><FONT FACE=monospace><br>*MyModalForm1<br>.ShowWindow=2&nbsp;&nbsp;&nbsp;(As Top Level)<br>.WindowType=1&nbsp;&nbsp;&nbsp;(Modal)<br>.cVal=&quot;before&quot;&nbsp;&nbsp;&& custom form property<br><br>*MyModalForm1.cmdBefore.click()<br>MESSAGEBOX(&quot;Thisform.cVal = &quot; + Thisform.cVal)<br>DO FORM MyModalForm2 TO Thisform.cVal<br><br>*MyModalForm1.cmdAfter.Click()<br>MESSAGEBOX(&quot;Thisform.cVal = &quot; + Thisform.cVal)<br><br>********************<br>*MyModalForm2<br>.ShowWindow=1 (In Top Level)<br>.WindowType=1 (Modal)<br><br>*MyModalForm2.Unload()<br>Return &quot;After&quot;<br></font><br>HTH<br>JohnDurbin<br>
 
Hey thanks JohnDurbin,<br>&nbsp;&nbsp;&nbsp;&nbsp;Your code and my code are, for all intensive purposes, exactly the same.&nbsp;&nbsp;The one thing that is different is in your MyModalForm2 I have <b>showwindow as 2 (As top level form)</b>.&nbsp;&nbsp;I figured that the user could move it wherever, but I guess they are limited the first form.&nbsp;&nbsp;Well, that worked, so thanks man.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top