Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2004, 02:01 PM
Authorized User
 
Join Date: Jun 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to sidneyfuerte Send a message via AIM to sidneyfuerte Send a message via MSN to sidneyfuerte Send a message via Yahoo to sidneyfuerte
Default MDI Child

I'm having a problem on Transfer Process to one of my mdi child form. Form1 is the first form that i show to a user. I'll have some processing running in form1 while its loaded... when a condition is meet.. i need to show form 2 and transfer the process from there... but what happend is the process will still continue in Form1 even if it form2 is already loaded.

How can I transfer the processing to Form2? and just resume the process in form1 after the user close Form2.

Thanks :)

Thanks/Regards
Sidney
__________________
Thanks/Regards
Sidney
 
Old July 16th, 2004, 04:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

are both form1 and form2 mdi child?
Marco
 
Old July 16th, 2004, 04:10 PM
Authorized User
 
Join Date: Jun 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to sidneyfuerte Send a message via AIM to sidneyfuerte Send a message via MSN to sidneyfuerte Send a message via Yahoo to sidneyfuerte
Default

Yes they are both MDI child... when i call form2 from form1.. the processing goes back to form1 right away.... although form2 was already loaded and shown.. the processing still goes back right away to form1. I want to transfer the process permanently to form2 until the user close the form.



Thanks/Regards
Sidney
 
Old July 16th, 2004, 08:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mdi cannot be displayed modally, therefore when in form1 you put the code

form2.Show

after form2 is loaded the flow of execution goes right back to the line following form2.Show

If you want to stop the execution after that line, you have to put that line exactly at the end of the event used to trigger show2, or put an exit sub just after.

form1.Show
exit sub

I form1 is not used anymore, put an unload me before exit sub. If you need to go back to form1 when form2 is done, add a public event to Form2. When form2 unloads (or whenever you want) raise that event. In form1 declare form2 as

Private withevents m_form2 as Form2

and restart the execution in form1 when that event is received.

And said that, if I were you I will create form2 and not an mdi, and display it modally.

Marco
 
Old July 18th, 2004, 08:11 PM
Authorized User
 
Join Date: Jul 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Or you could have a separate module (procedure) for the remaining of the code that you don't want to run while form 2 is being loaded. Upon closing/unloading form2 then resume that process, which will now be in another module. The idea here is that you could still call that module whenever you wanted to, even in your IF..ELSE statement in form1.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying MDI Child Form Menus with MDI Parent ashu_from_india Pro VB 6 3 June 10th, 2008 11:01 PM
Controlling MDI child form from MDI parent panel LuxCoder Pro Visual Basic 2005 1 May 25th, 2007 12:20 PM
Controlling MDI child form from MDI parent panel LuxCoder VB.NET 2002/2003 Basics 7 April 11th, 2007 02:38 PM
Controlling MDI child form from MDI parent panel LuxCoder VB How-To 1 April 9th, 2007 03:25 PM
Opening MDI Child on Button Click of MDI Child Sachin Shinde Visual Studio 2005 0 June 8th, 2006 05:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.