Need some newbie C# help. Need dock a form to another form.
-
I create an app in C# and put my controls on right side. I intend to dock an Outlook type toolbar on the left. So inside the development I have two forms My original form NHN.cs and my outlook bar called OLBar.cs I want to doc the OLBar.cs to the left side of NHN.cs. 1) How is this accomplished. 2) The Outlook Bar code that I download from http://www.codeproject.com/cs/miscctrl/outlookbar.asp seems to be a nice toolbar but for the life of me I can't get that docked to the left onto my NHN.cs form. Has anyone used this Outlook toolbar that might be able to offer some help OR does anyone know another way to add an outlook toolbar on a form? Many Thanks, Derek Derek@NeedHelpNow.com
-
I create an app in C# and put my controls on right side. I intend to dock an Outlook type toolbar on the left. So inside the development I have two forms My original form NHN.cs and my outlook bar called OLBar.cs I want to doc the OLBar.cs to the left side of NHN.cs. 1) How is this accomplished. 2) The Outlook Bar code that I download from http://www.codeproject.com/cs/miscctrl/outlookbar.asp seems to be a nice toolbar but for the life of me I can't get that docked to the left onto my NHN.cs form. Has anyone used this Outlook toolbar that might be able to offer some help OR does anyone know another way to add an outlook toolbar on a form? Many Thanks, Derek Derek@NeedHelpNow.com
You basically need to use the DockStyle to position elements on a container type object. You could create a panel to host your forms. Assuming Form1 is the one you want on the right side, you could do something like this: panelRight = new Panel(); panelRight.Dock = DockStyle.Fill; form1 = new Form1(); form1.Parent = panelRight; panelLeft = new Panel(); panelLeft.Dock = DockStyle.Left; splitter1 = new Splitter(); this.Controls.AddRange(new System.Windows.Forms.Control[] {panelRight, splitter1, panelLeft}); The order of adding things to this.Controls above is important. panelLeft could be the parent of your Outlookbar control. Gaulles http://www.gaulles.com
-
I create an app in C# and put my controls on right side. I intend to dock an Outlook type toolbar on the left. So inside the development I have two forms My original form NHN.cs and my outlook bar called OLBar.cs I want to doc the OLBar.cs to the left side of NHN.cs. 1) How is this accomplished. 2) The Outlook Bar code that I download from http://www.codeproject.com/cs/miscctrl/outlookbar.asp seems to be a nice toolbar but for the life of me I can't get that docked to the left onto my NHN.cs form. Has anyone used this Outlook toolbar that might be able to offer some help OR does anyone know another way to add an outlook toolbar on a form? Many Thanks, Derek Derek@NeedHelpNow.com
Derek Smigelski wrote: Has anyone used this Outlook toolbar that might be able to offer some I have used it. I use a panel (which I can change) that fills all the client area of my main window (panel.Dock = DockStyle.Fill). Then I create a Splitter, assignig its parent as the main form, and set its Dock property to DockStyle.Left. Finally I create the outlook bar, I assign its parent as the main form, and set its Dock property again to DockSytle.Left. And there, you have a resizable Outlook bar on the left. -- LuisR ────────────── Luis Alonso Ramos Chihuahua, Mexico www.luisalonsoramos.com "Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein