Custom Toolwindow in RadDock

5 posts, 0 answers
  1. shinu rag
    shinu rag avatar
    48 posts
    Member since:
    Feb 2010

    Posted 24 Apr 2010 Link to this post

    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
  2. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 29 Apr 2010 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Oliver
    Oliver avatar
    8 posts
    Member since:
    Nov 2015

    Posted 20 Nov 2015 in reply to Nikolay Link to this post

    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

  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 25 Nov 2015 Link to this post

    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
  6. Oliver
    Oliver avatar
    8 posts
    Member since:
    Nov 2015

    Posted 25 Nov 2015 in reply to Dess Link to this post

    Hello Dess,

    this is exactly what i needed.

    Thanks a lot for your help.

    Have a nice day.

    Regards,
    Oliver.

Back to Top
UI for WinForms is Visual Studio 2017 Ready