Question

I am using weifenLuo docking in windows form c#. In this opening image in 1 tab and on button click showing its information and operating functions in another tab. But if I click on that button again(from 1st tab), then it open another tab with same information means duplicate tab.

I dont want to open same tab again, on 2nd button click just want to focus old tab.

Here is picture of tabs

Was it helpful?

Solution

We use something similar to

private IDockContent FindDocument(string text)
{
    foreach (IDockContent content in dockPanel1.Contents)
    {
        if (content.DockHandler.TabText == text)            
                return content;
    }
    return null;
} 

And check would go something like

if (FindDocument(name) == null)
{
    dockContent.Name = name;
    dockContent.TabText = name;
    dockContent.Text = name;
    dockContent.ShowHint = DockState.Document;
    dockContent.Show(dockPanel1);
}

Hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top