Solved

Customize msgbox-liked function

Posted on 2002-04-07
7
144 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

803 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