hi,
i created 2o different windows forms for ma project,
but now m in big truble.
like iframe in web application...is ter any method in windows C# forms.
or any other method to solve this problem. ...and pls post details of how can i setup my project to exe file. with user name and pass word..protection..
pls ..pls.....
Loading
Nilanka DharmadasaPosted Nov 16, 2009, 3:41 AM
Let me explian you about it with an example.
Let's say you have a form called Form1. That's your main form.
You have a menustrip in that main form and you have added a menustrip item to the menustrip. When you click on the menustrip item, it creates another form inside the main from.
To do this, you should write your code as follows.
In your main form's constructor you should add this red line.
public Form1()
{
InitializeComponent();
this.IsMdiContainer = true;
}
Then you should wrtie following code in the click event of menu strip item.
private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
Form childform = new Form();
childform.MdiParent = this;//here, 'this' is Form1
childform.Show();
}
That's all you have to do.
Check it and let me know.
If you find this useful, please do not forget to mark this answer as accepted.
Nilanka DharmadasaPosted Nov 16, 2009, 5:03 AM
You can use the code I have given. Only change you have to do is, changing the names.
If you still feel you need help, paste your code here.
SreekanthPosted Nov 16, 2009, 4:27 AM
little more help...pls
i created main form with menustrip.. and i hav another form ,loginmasterfrm
by selecting login in menustrip i want open this from. in the MDI-main- form....
SreekanthPosted Nov 16, 2009, 2:58 AM
using menustrip in MDi form and by selecting one menustrip item corresponding will show in d MDI form's specific area.
Nilanka DharmadasaPosted Nov 16, 2009, 2:06 AM
You can use MDI froms concept to show one form inside another form, if it is what you want.
To create a setup project, you can add a setup project to your solution.