Docking NUIDocuments? (code)


Author
Message
Fábio Mello
Fábio Mello
Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)
Group: Forum Members
Posts: 12, Visits: 1
How can I make an initial display of NUIDocuments docked in a similar way to the sample attached?

Attachments
docking.jpg (216 views, 74.00 KB)
Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hello Fábio,

I guess you want to display context menu on the NUIDocument when the DocumentViewStyle is MdiTabbed.

There is no event exposed directly, but you can use the following workaround:

NDocumentPanel host = nDockManager1.DocumentManager.ActiveDocument.Host as NDocumentPanel;
if (host != null)
{
    NTabStrip tabStrip = host.Parent.Controls[0] as NTabStrip;
    if (tabStrip != null)
    {
        tabStrip.MouseClick +=
new MouseEventHandler(tabStrip_MouseClick);
    }
}

...

void tabStrip_MouseClick(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Right)
    {
        NDocumentPanel host = nDockManager1.DocumentManager.ActiveDocument.Host as NDocumentPanel;
        if (host != null)
        {
            NTabStrip tabStrip = host.Parent.Controls[0] as NTabStrip;
            if (tabStrip != null)
            {
                NContextMenu menu = new NContextMenu();
                //Add some commands.
                menu.Show(MousePosition);
                //To determine on which tab you have clicked you can use:
                NTab clickedTab = tabStrip.Tabs.TabFromPoint(e.Location);

            }
        }
    }
}



Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search