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

VisualStudio2005 look and feel

3 Answers 129 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Evgueni
Top achievements
Rank 1
Evgueni asked on 22 Feb 2007, 03:06 AM
I am brand new to Telerik.

I would like the DockPanel to have the look and feel of Visual Studio 2005. In particular, the pin icon, dropdown icon and close icon should look like the ones from VS 2005.

Could you please describe the steps necessary to implement that.

Thank you,

Evgueni

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 23 Feb 2007, 08:17 AM
Hello Evgueni,

To change DockPanel look & feel use the Visual Style Builder. You must create a new theme. To do so follow the steps bellow:

1) Open Visual Style Builder from the Start Menu -> All Programs -> telerik

2) Choose File -> Load Control -> Telerik.WinControls.Docking -> Dock Presenter Control

3) In "Control Structure" panel select:

RootRadElement > DockPresenterElement > DockPresenterLayout > DockPresenterCaptionElement > CaptionLayout > CaptionButton



There are three CaptionButtons (one for menu button, one for the pin button and one for the close button).

3) In "Expert Mode" panel go to the "Misc" section:



Here you can change the button image for different states (Active, Hovered, Clicked).

4) Change some other properties to achieve look & feel similar to VS 2005 one (e.g Fill and Border)

5) Optionally create VS2005 theme for DocumentPresenterControl, DropDownButton, TabStrip and DropDownButton.

6) Put the code below when you create DockPanels (This problem will be fixed in our next release)

DockPanel dockPanel = new DockPanel(); 
... 
DockPresenterElement element = ((DockPresenterControl)dockPanel.DefaultPresenter).DockPresenterElement; 
element.Children[2].Children[0].RadPropertyChanged += element_RadPropertyChanged; 
... 
void element_RadPropertyChanged(object sender, RadPropertyChangedEventArgs e) 
    if (e.Property == DockPresenterCaptionElement.ActivatedProperty) 
    { 
        RadElement element = (RadElement)sender; 
        foreach(RadElement el in element.ChildrenHierarchy) 
            el.SetValue(DockPresenterCaptionElement.ActivatedProperty, e.NewValue); 
    } 


I have attached sample theme file for your convenience. To install it use this code:

ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.File, @"c:\VS2005.xml"); 
dockingManager1.ThemeName = "VS2005"


Greetings,
Tsvetan Raikov
the telerik team
0
Evgueni
Top achievements
Rank 1
answered on 23 Feb 2007, 03:37 PM
Tsvetan,

Thank you for your detailed response. The only thing I am not sure is about the last paragraph where you say that you attached a sample theme. I cannot find the attachment.

Thank you,

Evgueni
0
Jack
Telerik team
answered on 26 Feb 2007, 09:14 AM
Sorry, Evgueni, my mistake. Here we go.
 

Best wishes,
Tsvetan Raikov
the telerik team
Tags
Dock
Asked by
Evgueni
Top achievements
Rank 1
Answers by
Jack
Telerik team
Evgueni
Top achievements
Rank 1
Share this question
or