Solved

Why my second form is missing after using another application in Visual Basic 6

Posted on 2014-07-22
4
223 Views
Last Modified: 2014-07-22
Hi guys,

I have form-A and Form-B, the form A is my main form and has the menu and also remains visible until the application is closed, when I choose an option from main menu, the program opens Form-B that becomes the active window and the main form becomes disabled. When I close Form-B, the Form-A becomes enabled again, so everything works perfect.

The problem is when I use another application let's say:

I have my main form-A and my form-B running suddenly, I open MSWord to do something and it becomes the active window, at this point everything is ok, but when I return to my Application, the form-B is missing and only see the Form-A, but disabled. So Where is my Form-B?

Thank you so much guys in advance.
0
Comment
Question by:elm9999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 15

Expert Comment

by:Ess Kay
ID: 40212415
the form b is in the background

What you should do instead of disabling it is to hide it
Set form1.visible = false

Or use it like an MDI

if you minimise word, you will see form2 is still there, behind it
0
 
LVL 21

Expert Comment

by:Randy Poole
ID: 40212430
You can also on the form_show of form a
if  not forma.enabled then formb.show
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 40212618
When you display the second form, display it as modal and specify the current form as the owner:
http://msdn.microsoft.com/en-us/library/aa244181(v=vs.60).aspx
Private Sub cmdShowResults_Click()
   ' Show a modal form named frmResults.
   frmResults.Show vbModal, Me
End Sub

Open in new window

0
 

Author Closing Comment

by:elm9999
ID: 40212772
Thank you so much guys.

Its' already done with Mike option.

Thank's
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question