Results 1 to 6 of 6

Thread: MDI Parent menu problems

  1. #1

    Thread Starter
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    MDI Parent menu problems

    A collegue of me has some problems with the menu's on an MDI parent.
    An MDI child has a usercontrol with a menu. This menu is merged with the MDI child's menu. No problem there.
    The problem is that the MDI parent's menu disappears as soon as the active MDI child has it's own menu (or an ActiveX control on this child form has a menu).

    Does anyone know how to merge the MDI parent's menu with the menu from the MDI child?
    Any workarounds or maybe some API calls to show the MDI parent's menu?

  2. #2
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    The only way round it is to not use MDI forms
    THEY ARE CRAP!

    The menu problem is just one problem. You will no doubt run into many more restrictions with an MDI form

    What you can do is create a normal form, with a grey background, which looks like an MDI form, then use:
    VB Code:
    1. Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    2.  
    3. Private Sub Form_Load()
    4.    SetParent Me.hWnd, frmMain.hWnd
    5. End Sub
    That'll get round most of the problems that an MDI form creates...

    Hope it helps,

    Woka

  3. #3
    Addicted Member
    Join Date
    Apr 2002
    Location
    Hyderabad,India
    Posts
    131
    But without MDI forms, how can you incorporate Document/View Architecture?

  4. #4

  5. #5
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    I had this problem a couple years ago. I found the following on another site.

    "An MDI form can only have one menu active. When a child window is active its menu moves to MDI form's menu bar. When all the child windows are closed the MDI form's menu bar is displayed. This makes a great deal of sense as the menu bar is always the menu associated with the active form."

    I posted this same reply a while back. Try searching for it, there may be some other helpful replies in the thread.

  6. #6

    Thread Starter
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    It makes more sense to merge the menu.
    If I need a menu item for all my child forms, I prefer to put it in the menu on the parent. Now i have to add it to all child forms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width