Results 1 to 4 of 4

Thread: Menu question

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    9

    Menu question

    I have an application that uses differents forms. Is there an advantage too using menus (ctrl-e) vs. click .show the form? ALso, how do I turn off the visability of the previous form after the new one appears. Thanks.

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Menu question

    Is there an advantage too using menus (ctrl-e) vs. click .show the form?
    I couldn't understand your question. Can you be a bit more clear?

    ALso, how do I turn off the visability of the previous form after the new one appears.
    To hide a form you call the Form's Hide method
    vb Code:
    1. Form1.Hide   '<-- Hides Form1
    The other way is to hide the form before you show the other form
    vb Code:
    1. Me.Hide                    ' Hide current form
    2. Form2.Show vbModal         ' Show the other form
    3. Me.Show                    'Show the form again after the 2nd form is closed
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Menu question

    Advantages of menus?
    1. Menus can offer functions that are not provided from controls on the form. For example. Many applications do not offer a "search button" but may offer a "Search" menu item.

    2. Going with what I said in #1 above, menus can replace unnecessary controls on a form, thus preserving form real estate.

    3. Accelerator items (i.e., Ctrl+C) can be more user-friendly for keyboard-junkies vs mouse-junkies. You'll never see me clicking Edit | Copy on a menu; I will hit Ctrl+C every time as that is my preference.

    To make a form invisible you can do 1 of 2 things.

    1. If the form is no longer needed and any user-entered data on that form is also no longer needed: Unload FormX from outside of the form or Unload Me from within the form.

    2. FormX.Visible = False from outside the form. Me.Visible=False from within.

    Edited: Pradeep1210's suggestion of using .Hide works as well.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    9

    Re: Menu question

    I was just popping menu prompts(forms) up on the screen but I noticed an example of one that used mnu commands. Seems like alot of extra worl to call the menu then then the menu to call the new form. I am sure someday I will use it, still a VB virgin.

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