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.
Printable View
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.
I couldn't understand your question. Can you be a bit more clear?Quote:
Is there an advantage too using menus (ctrl-e) vs. click .show the form?
To hide a form you call the Form's Hide methodQuote:
ALso, how do I turn off the visability of the previous form after the new one appears.
The other way is to hide the form before you show the other formvb Code:
Form1.Hide '<-- Hides Form1
vb Code:
Me.Hide ' Hide current form Form2.Show vbModal ' Show the other form Me.Show 'Show the form again after the 2nd form is closed
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.
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.