|
-
May 28th, 2003, 05:53 AM
#1
Thread Starter
Hyperactive Member
Form container
Hi all,
I have to design a form such that, it will contain a list of buttons or toolbar on the left side. Each time the user clicks on one of the buttons, it will load the corresponding sub/child form on the right side of the main form. Note that Mdi shold not be used. Now what I need is to know if its possible to make other forms appear inside a classic form in VB.Net. If so then how, should I place the forms in a container control. All help appreciated. thanx.
-
May 28th, 2003, 07:14 AM
#2
Do you have to use forms?
Can't you use Panel controls instead?
This world is not my home. I'm just passing through.
-
May 28th, 2003, 07:21 AM
#3
Fanatic Member
I did something similar with a treeview on the left and a tab control that would load the appropriate tabs for the treeview item selected. Then when the user clicked on a tab, I would actually go and load the tab page content.
-
May 28th, 2003, 09:19 AM
#4
Fanatic Member
Hi
Put two panels on your main form. The panel on left will hold your menup buttons (pnlButton) and the one on the right will act as container for your forms (pnlForm). When you click on a button instantiate the corresponding form and change its container property to that of the pnlForm panel. Your forms should be window less.
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
May 28th, 2003, 11:55 PM
#5
Thread Starter
Hyperactive Member
Thanx Mr.No, but isn't the Container property of a form Read Only?
Last edited by vbud; May 29th, 2003 at 12:22 AM.
-
May 29th, 2003, 04:16 AM
#6
Fanatic Member
You're right, didn't know that. I think you should look for a property or method in the Panel control or any other container control that allows you to drop controls on them so that you could add your instantiated form into it.
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Jul 7th, 2003, 05:48 PM
#7
Addicted Member
At last...
private void button1_Click(object sender, System.EventArgs e)
{
Form frm = new frm_Tasks(); //Create an instant of the form
frm.TopLevel = false;
frm.Parent = pnl_main;
frm.Show(); //Display the form
}
Control Data Systems
www.members.shaw.ca/cdsystems
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|