Solved

Customize msgbox-liked function

Posted on 2002-04-07
7
142 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
Comment Utility
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
Comment Utility
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
Comment Utility
Not a problem as long as it isn't defined as mdichild=true
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 1

Author Comment

by:falconew
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

762 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

11 Experts available now in Live!

Get 1:1 Help Now