Results 1 to 5 of 5

Thread: How to share a menu bar between two forms?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    7

    How to share a menu bar between two forms?

    Hey, everybody.

    I'm writing a small software similar to the calculator in Windows, the calculator in Windows has a menu bar; in the menu bar, you can find "scientific" and "standard" mode; once you select different mode, your form will be changed, but the two forms still share the same menu bar.

    I want to create the same effect of this:
    1. Two forms, only one is visible at any time
    2. The menu bar on the top of the two forms should be shared between these forms

    I just started learning VB for 2 weeks, I'm not sure my thinking can be achieved by VB, if not, please inform me the right way to do it.

    Please give details since I'm just a beginner.

    Thank you very much for your time in advance

  2. #2
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Re: How to share a menu bar between two forms?

    Its not that hard or time consuming to add two different menus to two different forms, unless you have any other specific reason to do the same.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    7

    Re: How to share a menu bar between two forms?

    Hey, aashish. Thanks for your reply.
    Do you mean to have seperate menu for two forms? But there is a connection between them.
    If you have a look at the claculator in Windows, it indicates which mode you are using now -> a black dot in front of the current mode, so how can I do this if I implement by using seperated menu?

    Thanks in advance

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: How to share a menu bar between two forms?

    don't use more than one form.... have two different views on the same form.

    put each view in a panel. Dock both to fill. then on the menu click event, hide one panel and show the other, and resize the form.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    7

    Re: How to share a menu bar between two forms?

    Thanks for your reply, you are right, two forms will be a bad way to do it.

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