0

I'm a Student of C# and doing a Windows Form Application using in visual studio 2012. The problem that i have is.

I have a parent form with a menustrip = File, with sub item Login and on Login item Click the Child form loads so you can enter your login details. The problem that i'm having is when i click the login click button on the Child Form i need to

Add MenuStrip name "Add", with sub items names "Edit","Copy"; Also Add DatagridView;

To the Parent Form, can anyone give me a step in the right direction please

Amit Joki
  • 58,320
  • 7
  • 77
  • 95
Ger
  • 1
  • 2
  • Short answer is "no, you don't". Your login form should log someone in. You parent form should change based on the result of login form. Look around here how to transport a result back between Forms and then, in your parent form, handle this result by changing itself. – nvoigt Mar 24 '14 at 16:38
  • Sorry maybe didn't explain well in my Parent form i have the menustrip and datagridview set as visible = false; on Parent_Laod. And i was trying to call a event on the button_click to make the above visible = true; – Ger Mar 24 '14 at 18:10

1 Answers1

0

From my understanding you could go about this two different ways.

First is to use the DialogResult that is received back from childForum.ShowDialog(this); Which you can set in the child form's closing event. (If you don't need data back from the child form) Very similar to how you get results back from a MessageBox.Show();

Second would be to trigger an event that your main form is listening for that sets your data when received. (If you need to pass data between the two) - simple custom event

Community
  • 1
  • 1