?
Solved

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

Posted on 2014-07-22
4
Medium Priority
?
224 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 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 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