Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Stimulsoft Reports.NET discussion
Post Reply
mace242
Posts: 43
Joined: Tue Aug 21, 2007 9:24 am

Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Post by mace242 »

I'm strimming down a designer I've placed on a form. I want to - by default hide the Dictionary, Report Tree and Properties tabs in the stiDesignerControl. What I want to do is by default either hide the tabs totally - just as if the user had clicked on the X button, or unpin them - just as if the user had clicked on the pin button. Any ideas how I may do this.

Thanks,

Tim.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Post by Edward »

In the build from August, 22 we've added a StiDesigner.LoadedDesigner static event. This event is used in the code of this topic.

Please define the following command in any place of your program but be sure that it will be called only once:

Code: Select all

StiDesigner.LoadedDesigner += new EventHandler(this.StiDesigner_LoadedDesigner);
Also please define the event handler:

Code: Select all

private void StiDesigner_LoadedDesigner(object sender, EventArgs e)
{
    StiDockingPanel dockingPanel;
    StiDesigner designer = sender as StiDesigner;
    StiPanelService serviceTree = StiReportTreePanelService.GetService(designer);
    if (!serviceTree.DockingControl.IsVisible)
    {
        designer.DockingManager.ClosedControls.Remove(serviceTree.DockingControl);
        dockingPanel = new StiDockingPanel(designer.DockingManager);
        dockingPanel.Controls.Add(serviceTree.DockingControl);
        dockingPanel.DockPanelToForm(designer, serviceTree.DockStyle);
    }
    StiPanelService serviceDictionary = StiDictionaryPanelService.GetService(designer);
    if (!serviceDictionary.DockingControl.IsVisible)
    {
        designer.DockingManager.ClosedControls.Remove(serviceDictionary.DockingControl);
        dockingPanel = new StiDockingPanel(designer.DockingManager);
        dockingPanel.Controls.Add(serviceDictionary.DockingControl);
        dockingPanel.DockPanelToForm(designer, serviceDictionary.DockStyle);
    }
    StiPanelService serviceProperties = StiPropertiesPanelService.GetService(designer);
    if (!serviceProperties.DockingControl.IsVisible)
    {
        designer.DockingManager.ClosedControls.Remove(serviceProperties.DockingControl);
        dockingPanel = new StiDockingPanel(designer.DockingManager);
        dockingPanel.Controls.Add(serviceProperties.DockingControl);
        dockingPanel.DockPanelToForm(designer, serviceProperties.DockStyle);
    }
}
Thank you.
mace242
Posts: 43
Joined: Tue Aug 21, 2007 9:24 am

Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Post by mace242 »

Excellent. Thanks.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Post by Edward »

Let us know if you need any help.

Thank you.
Post Reply