• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Customize msgbox-liked function

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
falconew
Asked:
falconew
  • 3
  • 2
  • 2
1 Solution
 
aikimarkCommented:
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
 
falconewAuthor Commented:
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
 
aikimarkCommented:
Not a problem as long as it isn't defined as mdichild=true
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
falconewAuthor Commented:
Have you tried it yourself. I have tried it and it is modal with all mdichild form including the MDIParent form.
0
 
MayaOneCommented:
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
 
falconewAuthor Commented:
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
 
MayaOneCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now