How close NUIDocument


Author
Message
Pavel Kozak
Pavel Kozak
Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)
Group: Forum Members
Posts: 10, Visits: 1

I use the tabs on NUIDocument to display various elements on the meringue and WinForm UserControl as follows:

private static NUIDocument ShowDoc(Form DocForm, string Title, string Key, int Index)
{
DocForm.TopLevel = false;
DocForm.FormBorderStyle = FormBorderStyle.None;
DocForm.ShowIcon = false;
DocForm.ShowInTaskbar = false;
DocForm.Dock = DockStyle.Fill;
DocForm.Show();

NUIDocument doc = new Nevron.UI.WinForm.Controls.NUIDocument();
doc.Client = DocForm;
doc.Text = title;
doc.Key = Key;
doc.ImageIndex = Index;

DockMng.DocumentManager.AddDocument(doc);
return doc;
}

This works fine, help with:

1. Is this correct?
2. As with inside DocForm (Form) with reference to the parent NUIDocument properly close a tab that we have created.
Angel Chorbadzhiev
Angel Chorbadzhiev
Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)
Group: Forum Members
Posts: 139, Visits: 184

Hello Pavel,

Better solution is instead of using Form to use a Panel. It is more lightweight and you don't have to worry about it when close the NUIDocument.

Regards,


Pavel Kozak
Pavel Kozak
Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)
Group: Forum Members
Posts: 10, Visits: 1
This decision was also, but the Form and UserControl like so that they can design in the designer.
If I do not got it wrong, then the problem remains the same.

My task - to place on the Form or Panel button with the action of "Close", which should properly close NUIDocument which is this component!
As an interim, I call the "NUIDocument". Host.Destroy () and the tab is closed, but it is barbarism, and as I understand the consequences.
As with reference to NUIDocument properly close it, ie as gross pressed the "cross" in the row of tabs with titles of documents.

Pavel.
Angel Chorbadzhiev
Angel Chorbadzhiev
Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)
Group: Forum Members
Posts: 139, Visits: 184

Hi Pavel,

If I understand correctly you want to close NUIDocument by let say pressing a button that resides in it.

If is so try to do the following:

nDockManager1.DocumentManager.CloseActiveDocument();

Regards,

Angel.


Pavel Kozak
Pavel Kozak
Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)
Group: Forum Members
Posts: 10, Visits: 1
Thanks, it works fine.

But I have now the task a little more complicated. There are events in the system, which should close all the tabs with specific content. And in this case CloseActiveDocument no longer valid, I have a handler of this event is a reference to DocumentManager NUDocuments and those who want to close, as you can perform this operation?
Angel Chorbadzhiev
Angel Chorbadzhiev
Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)
Group: Forum Members
Posts: 139, Visits: 184

Hi Pavel,

In this case you can remove the desired documents by calling RemoveDocument method of the document manager for each of them:

nDockManager1.DocumentManager.RemoveDocument(myDoc);

Regards,

Angel.


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