Solved

Windows Form

Posted on 2006-06-14
7
238 Views
Last Modified: 2012-05-05
This is probabbly a really simple question.  I have created blank application.  On this I've added a context menu.  I added a few menu choices to this.

Can someone explain how I navigate to different areas of the application.  For example say if the opening form would have a label displaying the text "Form1". what would I need to do if I wanted to cick a button in the menu that would change the form and display a button instead ?

I'm guess I'm asking if I would need two forms ?

If this is the case is the best pratice to create a template so that if I did this and then changed the orginal design all the other forms I've created would automatically update ?

Thanks.
0
Comment
Question by:andyw27
  • 2
7 Comments
 
LVL 7

Expert Comment

by:foobarr
ID: 16906620
In your menu click event you would put your code that you want to happen

so if you want something to happen when you press a button you put it in the button click event.  If you want it to happen when you click on the menu put it in the menu click event.  There are more events then just clicking VS lists a whole bunch of em


You don't necessarily need two forms you coupld simply just hide the label and make the button visible


in the menu click

label1.visible = false
button1.visible = true


if you want to change to a new form you can go
frmOld.hide()
frmNew.show()

and in the design of the frmNew have your button added to it

0
 

Author Comment

by:andyw27
ID: 16906699

Okay thanks.  I tried the code you suggested however I get a name not declared error ?
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 16906775
Hi andyw27;

You need to have created the Button or Form before you can use the Visible = True or False or created the Form before you can Hide or Shoe.

Fernando
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 17072978
Hi Bob;

I would like to see a resolution to this question seeming that the help that foobarr and myself gave andyw27 must have solve the issue seeming no more questions.

Thanke;

Fernando
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now