|
-
Jul 21st, 2004, 01:12 AM
#1
Thread Starter
Lively Member
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?
-
Jul 21st, 2004, 03:01 AM
#2
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.
-
Jul 21st, 2004, 03:13 AM
#3
Thread Starter
Lively Member
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.
-
Jul 23rd, 2004, 07:40 PM
#4
Thread Starter
Lively Member
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.
-
Jul 23rd, 2004, 07:48 PM
#5
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...
-
Jul 23rd, 2004, 10:59 PM
#6
Thread Starter
Lively Member
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.
-
Jul 24th, 2004, 03:02 AM
#7
Hyperactive Member
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?
-
Jul 24th, 2004, 07:40 AM
#8
Hyperactive Member
Regards,
Vishalgiri Goswami
Gujarat, ( INDIA ).
---------------------
-
Jul 24th, 2004, 09:55 PM
#9
Thread Starter
Lively Member
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.
-
Jul 27th, 2004, 03:57 AM
#10
Thread Starter
Lively Member
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:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu frmMain.mnuInvisible
End If
End Sub
When I execute this code, I get "Only one MDI form allowd.
I've also tried:
VB Code:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu ParentForm.mnuInvisible
End If
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|