Moving Menus from one form to another (Without MDI) 
Author Message
 Moving Menus from one form to another (Without MDI)

Let me clarify a point I forgot to mention - I want to do this without
MDI forms, as I want the main form (see below) to be similar to the VB4
main form, so when it is maximised, it doesn't take up the entire
screen.

This is what I posted earlier...

I was wondering if anybody knows how to 'move' a menu bar from one form
to another. Say I had a main form with the menu bar on it, depending on
what form was open the entire menu bar would change accordingly. The
form that is open actually holds the menu bar, and it should get moved
to the main form. Then if a different form is opened, then the different

menu bar is moved from it to the main form.

I've worked out how to move the actual menu 'labels' etc, but the
relevant code doesn't go with it... Can this be achieved with API calls,

or am I using the wrong ones??

Craig



Tue, 04 Jul 2000 03:00:00 GMT  
 Moving Menus from one form to another (Without MDI)

There is no easy way to cause the menu event associated with one form to be
executed by anothers in the way you want..but it can be done with a little
work. You can extract the menu handle along with the label, which you say
you have already done. You can then use the menu handle to cause a popup
menu to be displayed when the "migrated" label is selected using the API
TrackPopupMenu. You can also use the GetMenu... API's to extract
information about each entry.
As each window becomes active it would call the "build main menu" routine
with it's window handle. You would then build the main window menu based on
that handle. Store the handles/labels so that when one is selected you can
create the popup. Since you are using the menu defined to the "real" window
the associated menu event will fire.

Look at VB programmers guide to win api - it has a s chapter dedicated to
menu processing.

E-mail me if you have questions.

Good Luck !

Anthony J. Elcocks



Quote:
> Let me clarify a point I forgot to mention - I want to do this without
> MDI forms, as I want the main form (see below) to be similar to the VB4
> main form, so when it is maximised, it doesn't take up the entire
> screen.

.
.
.
Quote:
> I've worked out how to move the actual menu 'labels' etc, but the
> relevant code doesn't go with it... Can this be achieved with API calls,

> or am I using the wrong ones??

> Craig



Tue, 04 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Moving Menus from one form to another

2. MDI interface without a MDI form?

3. Move one form - the other moves with it?

4. How to make menu in MDI child appear together with MDI form

5. Menu, MDI form and MDI child

6. MDI Form's menu replaced by MDI Child

7. MDI and Child Form Menus / Menu Editor

8. Q: How do I move a child form in an MDI form

9. MDI Menu with Child form Popup menu's

10. MDI forms and Child Form Menus

11. Menus with MDI form and child form

12. Q: Form activate Fires On Non Child MDI Forms But Only Once On Child Mdi Forms

 

 
Powered by phpBB® Forum Software