Page 1 of 1

Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Posted: Tue Aug 21, 2007 9:28 am
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.

Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Posted: Wed Aug 22, 2007 8:38 am
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.

Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Posted: Thu Aug 23, 2007 5:28 am
by mace242
Excellent. Thanks.

Hide Dictionary, Report Tree and Properties Tabs in stiDesignerControl

Posted: Fri Aug 24, 2007 9:29 am
by Edward
Let us know if you need any help.

Thank you.