?
Solved

Customize msgbox-liked function

Posted on 2002-04-07
7
Medium Priority
?
148 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
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 46

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 46

Expert Comment

by:aikimark
ID: 6924642
Not a problem as long as it isn't defined as mdichild=true
0
Technology Partners: 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!

 
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 75 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

Independent Software Vendors: 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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

800 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