Results 1 to 10 of 10

Thread: MDI Forms & Menus

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    98

    MDI Forms & Menus

    It seems I'm having a lot of issues with MDI forms at the moment!!!!!! I'm still relatively new to the whole MDI thing, so please bear with me.

    OK, I've got a menu as part of the main MDI parent. On many of the child forms I've also got a context-sensitive popup menu associated with the form. Whenever one of these forms load, the menubar in the MDI parent disappears.

    Is there any way to solve this issue?

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    In reponse to your first post the MDI form inherits the menus of the active child form(if it has a menu).
    The only way around this that I can think of is to duplicate the main menu in all the child forms.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    98
    Hmmm ... deleted second post. I'm getting my threads mixed up. My brain isn't functioning at the moment

    Incidentally, if someone can think of a better way of doing this, it would be very much appreciated.

    If it's any help all the forms share the same menu, it's just embedded into each of the forms. I'm thinking some sort of public property to simplify things (they all then share one copy of the menu), but I don't know enough about them or how to use them, and then somehow attach that public property to both the main parent menu bar and the child form when the form is loaded.
    Last edited by dogwomble; Jul 21st, 2004 at 04:48 AM.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    98
    Sorry for being annoying and bumping this thread, but if someone can think of a better solution it'd be appreciated. I'm not keen on duplicating the menu across another 21 MDI child forms.

  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263
    I've done lots of MDI work but not much pop-up menu with that...

    But for a suggestion - why not put all the pop-up menu trees on the parent and reference them from there - NO MENU's on any child forms at all?

    This might be a stupid idea - but what the heck...

    And for a sidebar - you can move MENU objects between form files with NOTEPAD on the .FRM file - even write a VB program to copy them...

  6. #6

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    98
    I've already tried doing that, and whenever I try, it gives me an error along the lines of "Only one MDI parent allowed". I'll have a bit more of a play though.

  7. #7
    Hyperactive Member Trojan's Avatar
    Join Date
    Dec 2003
    Location
    Area 51
    Posts
    280

    well...

    If you put all your menus in the MDI parent and make the popup menus invisble then what ever MDI child form that is displayed it won't change the MDI parent menus..

    get it?

  8. #8
    Hyperactive Member Vishalgiri's Avatar
    Join Date
    Oct 2003
    Location
    India
    Posts
    345
    I agree with Trojan
    Regards,
    Vishalgiri Goswami
    Gujarat, ( INDIA ).
    ---------------------

  9. #9

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    98
    Yeah, I understand that. It's just when I've tried doing this sort of thing previously, I've had problems because of the fact the menu is in a popup form. It keeps complaining with the error "Only one MDI parent allowed" (I think ... I'm just relying on my memory here). When I get a chance I'll have another play and let you guys know how I go.

    Sorry, I'm still coming to grips with the whole MDI concept.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    98
    OK, so what I've got now is a single menu on the parent form called mnuInvisible. I'm trying to call this from a client form. The code is as follows:

    VB Code:
    1. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.     If Button = 2 Then
    3.         PopupMenu frmMain.mnuInvisible
    4.     End If
    5. End Sub

    When I execute this code, I get "Only one MDI form allowd.

    I've also tried:

    VB Code:
    1. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.     If Button = 2 Then
    3.         PopupMenu ParentForm.mnuInvisible
    4.     End If
    5. End Sub

    But that gives me an "object required". What is it I'm doing wrong here?

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