Solved

Windows Form

Posted on 2006-06-14
7
244 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

16 Experts available now in Live!

Get 1:1 Help Now