Accessing Other Instances while MODAL win up?!?

I have create 3 forms. The first form creates 3 instances of Form2 and displays them on screen. In Form2's Load event i tell it to create an instance of Form3 and display it as a MODAL window.  When i do this all of my Form2 instances are frozen until Form3's window is shut down. I can make Form3 modeless allowing me to have FULL access to my Form2 instances BUT i do not want ot have clickable access to ANYTHING (MODAL) on the form that popped up the Form3 instance. So, how do i have a MODAL window pop up on a specific form instance so as to not allow me to click (or have any user access to) that form that caused the MODAL window to pop up WHILE allowing me to have COMPLETE access to the other Form instances?

Here is example code on what i mean:
----------
FORM 1:

Dim x() As Form2

Private Sub Form_Load()
    ReDim x(2)
   
    Set x(0) = New Form2
    Set x(1) = New Form2
    Set x(2) = New Form2
   
   'I make it MODELESS here so i can display all instanes right away
    x(0).Show
    x(1).Show
    x(2).Show
End Sub

---------
FORM 2:

Dim x As Form3
Private Sub Form_Load()
    Set x = New Form3
   
   'For this Form instance i want to display Form 3 as a modal window (so i cant have user access to this form instance while it is up) BUT i still want to have access to the other Form 2 instances. This is the problem!
    x.Show 1
End Sub

----------
FORM 3:

Just add a Label to it with a caption = "Waiting..."
ljaquesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mark2150Commented:
System modal is just that. If you want things to hold on that window, then every will *HOLD*. Sounds to me like you're trying to have it both ways. System would seem to be behaving correctly if I read your question right. Forms are independent at this level. You can't have it modal to one form and non-modal to another. If it's modal, it's modal to everyone.

M

0
ljaquesAuthor Commented:
mark2150,
  Thanks for the info but it doesn't solve my problem. Have any suggestions to solve my dilema?
0
ljaquesAuthor Commented:
I was just goofing around in VB right now and i notice that if i set the form's ENABLE property to = false when i pop up a MODELESS form (in this case it was FORM3) then i have complete access to the other instances (form2) while preventing user input to the form that caused the form3 instance to pop up. I thought by setting the ENABLE property to equal FALSE would prevent any events from occuring to this form but when i added the Timer control to it, the disabled form was able to receive events, which works great for me. Please let me know if this is a viable solution or does it have a nasty side-effect.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

caraf_gCommented:
Sounds good!
0
mdouganCommented:
No, that is probably the best solution for you.  Actually, I'm surprised that you were ever able to run that code, as you are only allowed to open one modal window at a time.  In your code above, you were creating 3 instances of form2 and each one was trying to open a modal form3.  This should have caused you problems.  

Another thing you could have done is in the Deactivate event for form3 you could see which other form was now the Screen.ActiveForm and if it was form3's parent - form2 then it could beep and set the focus back on itself.  Since your form2s are dynamically created, knowing which instance of form2 was the parent of that particular instance of form3 would be a little tricky.

MD
0
mark2150Commented:
His app was most likely halting after it created the first instance of FORM2 which chained to the Modal Form 3.

I'd solve it by restructuring my program logic. Generally, if you're getting into this type of precedence trap it's a sign that you're coming at the problem from the wrong direction. Rather than butt my head against the wall trying to circumvent the operation of the OS, I'd ask myself how else I could solve this. For example, why do you need to pop three *identical* forms? Why not pop just one and wait for that to complete (since that what the modality is requiring anyway!) before popping the next. I generally feel that it's an error to toss a window at a user that they *can't* interact with! Why show them *anything* if they're not allowed to tinker?

Just my $.02.

M

0
rondeaujCommented:
Private Sub Form_Load()
    ReDim x(2)
     
    Set x(0) = New Form2
    Set x(1) = New Form2
    Set x(2) = New Form2
     
   'I make it MODELESS here so i can display all instanes right away
    x(0).Show
    x(1).Show
    x(2).Show
    doevents
    form3.show modal,parentform
End Sub

do not load the form until the other form are loaded. You can't do it the way you want to.  So you must find another way to make it work.  Are you going to want to load this form3 everytime form2 is load?  if so you should check the value of the form array against the ubound() value of the array and with the use of a If....Then ......end if wait until the last form has loaded and then load form3.


form2_load

  dim numofforms as integer
  numofforms = ubound(form2array)
  if form2.index = numofforms then form3.show modal,parentwindow

end sub


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.