Solved

Customize msgbox-liked function

Posted on 2002-04-07
7
143 Views
Last Modified: 2010-05-02
I want to show a mdiChild form and will be modal to another mdichild form and just modal to that form. I mean the form will function like msgbox function so that the next process can not continue until clicking the "OK" button of the msgbox.
How do I make a form like the msgbox function?

Regards,
Falconew
0
Comment
Question by:falconew
  • 3
  • 2
  • 2
7 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 6924611
Use the vbModal parameter when you show the form.  Please note that mdiChild forms can not be shown modally, so you will need to have two copies of the form, differing only in their MDIChild property settings.

Example:
frmChild2.Show vbModal
0
 
LVL 1

Author Comment

by:falconew
ID: 6924637
aikimark,

I need the form only modal to a specified form. I don't want the form modal to all forms including the MDI form. It is like the msgbox function modal to the form that calls it.

Regards,
Falconew
0
 
LVL 45

Expert Comment

by:aikimark
ID: 6924642
Not a problem as long as it isn't defined as mdichild=true
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:falconew
ID: 6924646
Have you tried it yourself. I have tried it and it is modal with all mdichild form including the MDIParent form.
0
 

Accepted Solution

by:
MayaOne earned 25 total points
ID: 6924699
It seems that what you want its to disable/lock the parent window while the child window is open, beeing both windows MDIChild, but whidout lock other MDIChild... right?

Whell this code should do that:

'This code in the parent window
   dim frmChild as Form

   set frmChild = new Form
   set frmChild.parent = me
   let me.enabled = false
   call frmChild.show(vbmodeless)

'this code in the general (module level declarations)
'section of the child window
Public parent as form

'this code in the query unload event of the child window
let parent.enabled = true
set parent = nothing

Its very important to set the public variable "parent" in the child window (with the reference to the parent window) to nothing in the query unload of the child window or else the child window never really unload (you can verify this with a debug.print "child unloaded" in the terminate event of the child window)
0
 
LVL 1

Author Comment

by:falconew
ID: 6935735
Hi,

Your trick is good but I have a litle problem when implement this. When the child form is shown and the parent form is disable, I need the parent form visible in the menu window list not the child form.
Any other tricks?

Regards,
Falconew
0
 

Expert Comment

by:MayaOne
ID: 6936379
Sure... just edit the caption of the menu with apis (put the parent window caption)

you can look this class as a start point about it

URL
http://www.codearchive.com/newcode/dataselect/select.cgi?section=misc&area=vbasic&startat=0

Search the page for the text "M.C. Menu Voodoo"
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now