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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate Main Forms, WHY?

Status
Not open for further replies.

TJay

Programmer
Nov 25, 1998
14
0
0
US
I've got a main form with a button when clicked shows a new form in which I select a file to work with and assign the data to the main form ( some labels, msflexgrid). <br>At the end of the 2nd form I can .hide the 2nd form or unload the 2nd form&nbsp;&nbsp;( either one ) and I get the main form but the data is not <br>there. If I mainform1.SHOW the main form then I get a duplicate main form WITH the DATA but behind it is the original blank Main Form which I don't want. Why do I get the duplicate main form and how to I get rid of it.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
if you are working with a second form that acts as a dialog it is best to use modal forms<br>like say<br>SecondForm.Show vbModal, Me<br>this will make it so that you cant go back to the original form, until you are done with the second(you can change the first form, from the second then close the second by just unloading it), then when you unload the second form, then you get control of the original first form again. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
I still get a duplicate Main form ( 2 Main forms, 1 with the data and 1 additional duplicate main form behide it without the data).<br>I just want 1 copy of the Main form. ????
 
show me the code you use when calling the second form from the main form? <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
csFrmcreate.Show vbModal, Me<br><br>There is a file selected from the 2nd form csFrmCreate and then a button to process the file and when it is finished assigning data to the Main form, the 2nd form csFrmCreate ends.<br><br>If I don't csFrmMain.show at the end of the code executed by the button on the 2nd form csFrmcreate,&nbsp;&nbsp;&nbsp;the Main form is displayed but without the data in the msflexgrid OR the text boxes.<br><br>If I do csfrmMain.show at the end of the code executed by the button on the 2nd form csFrmCreate,&nbsp;&nbsp;the Main form is displayed correctly WITH the data in the msflexgrid and the text boxes BUT, their is the original duplicate copy of the Main form ( data less ) behind the Main form on top ( that has the data ). <br>Why 2 copies? What am I doing wrong?<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top