This is a migrated thread and some comments may be shown as answers.

Custom Toolwindow in RadDock

4 Answers 245 Views
Dock
This is a migrated thread and some comments may be shown as answers.
shinu rag
Top achievements
Rank 1
shinu rag asked on 24 Apr 2010, 12:53 PM
hiii

i just add 4 windows forms as tol window in a dock control, but i can't set its location that i need...
how can i set the form location in raddock.

i'm using these codes form adding forms to raddock but it shwoing as verticle.. i need to re order it like 2 column and 2 row table.. i mean the first row have 2 frms and second row too...
how can i ???
            frm1 = new Form(); 
            frm2 = new Form(); 
            frm3 = new Form(); 
            frm4 = new Form(); 
 
            
 
            frm1.BackColor = Color.Pink; 
            frm1.Text = "My Form1"
            this.radDock1.DockControl(frm1, DockPosition.Right); 
 
            frm2.BackColor = Color.Pink; 
            frm2.Text = "My Form2"
            this.radDock1.DockControl(frm2, DockPosition.Left); 
 
            frm3.BackColor = Color.Pink; 
            frm3.Text = "My Form3"
            this.radDock1.DockControl(frm3, DockPosition.Left); 
 
            frm4.BackColor = Color.Pink; 
            frm4.Text = "My Form4"
            this.radDock1.DockControl(frm4, DockPosition.Left); 
Thanks,
Shinurag

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 29 Apr 2010, 08:35 AM
Hello shinu rag,

Thank you for the question.

Please refer to the following code snippet. It demonstrates how to set the desired layout:
this.radDock1.MainDocumentContainerVisible = false;
  
Form frm1 = new Form();
Form frm2 = new Form();
Form frm3 = new Form();
Form frm4 = new Form();
  
frm1.BackColor = Color.Pink;
frm1.Text = "My Form1";
this.radDock1.DockControl(frm1, DockPosition.Top);
  
frm2.BackColor = Color.Pink;
frm2.Text = "My Form2";
this.radDock1.DockControl(frm2, this.radDock1.DockWindows[0], DockPosition.Right);
  
frm3.BackColor = Color.Pink;
frm3.Text = "My Form3";
this.radDock1.DockControl(frm3, DockPosition.Bottom);
  
frm4.BackColor = Color.Pink;
frm4.Text = "My Form4";
this.radDock1.DockControl(frm4, this.radDock1.DockWindows[2], DockPosition.Right);

I would suggest that you take a look at the following documentation article:
http://www.telerik.com/help/winforms/example_building_advanced_layout_at_runtime.html
It describes the possible layouts that you can achieve by using the methods and properties of RadDock.

All the best,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Oliver
Top achievements
Rank 1
answered on 20 Nov 2015, 02:49 PM

Hello Nikolay,

i`m searching fpr a solution to change the color of the ToolWindow-TitleBar when it is focused.

I`m using a Windows 8 Theme and everyone ist fine.

Is there a possibilty to change the Focus-Color (from blue to grey) w/o changing the Theme?

Kind regards

Oliver

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Nov 2015, 11:55 AM
Hello Oliver,

Thank you for writing.

You can achieve your goal by using the ActiveWindowChanged event and applying the desired color to the ToolTabStrip.CaptionElement's fill:
public Form1()
{
    InitializeComponent();
    this.radDock1.ActiveWindowChanged += radDock1_ActiveWindowChanged;
}
 
private void radDock1_ActiveWindowChanged(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
{
    ToolWindow tw = e.DockWindow as ToolWindow;
    if (tw != null)
    {
        ToolTabStrip tabStrip = tw.TabStrip as ToolTabStrip;
        FillPrimitive fill = tabStrip.CaptionElement.FindDescendant<FillPrimitive>();
        if (fill != null)
        {
            fill.BackColor = Color.Gray;
            fill.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
        }
 
        foreach (ToolWindow t in this.radDock1.DockWindows.ToolWindows)
        {
            if (t != tw)
            {
                ToolTabStrip ts = t.TabStrip as ToolTabStrip;
                FillPrimitive f = ts.CaptionElement.FindDescendant<FillPrimitive>();
                if (f != null)
                {
                    f.BackColor = Color.White;
                    f.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
                }
            }
        }
    }
}

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Oliver
Top achievements
Rank 1
answered on 25 Nov 2015, 12:16 PM

Hello Dess,

this is exactly what i needed.

Thanks a lot for your help.

Have a nice day.

Regards,
Oliver.

Tags
Dock
Asked by
shinu rag
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Oliver
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or