Profile Picture

NDockZone positioning

Posted By Greg Wilson 15 Years Ago
Author
Message
Greg Wilson
Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 15 Years Ago
Posts: 2, Visits: 1
Angel Chorbadzhiev,

Thank you very much.

Angel Chorbadzhiev
Posted 15 Years Ago
View Quick Profile
Supreme Being

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
Last Active: Last Month
Posts: 139, Visits: 184

Hello Greg,

When you add the NDockZone as a child in the root zone using AddChild method the dock zone was added at the end of the Children collection.

For example if the root zone orientation is horizontal the children will be ordered from left to right by their index in the collection.

To put your zone on left side you have to use the other override of AddChild method where you also have to pass also and the index of your zone in the collection:

_manager.RootContainer.RootZone.AddChild(leftZone, 0);

This way the leftZone will be added on the first position in Children collection and it will be placed in the most left (top) position.

Regards,

Angel Chorbadzhiev



Greg Wilson
Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 15 Years Ago
Posts: 2, Visits: 1
I have created a NDockZone that contains a single NDockingPanelHost. If I set the NDocumentManager root zone orientation to vertical my zone and its contents always show up below the document(NUIDocument) and if the orientation is horizontal the zone and its contents always show up to the right of the document(NUIDocument). How can I specify the zone to show up to the left or top depending on the orientation?

example code...

_manager.DocumentStyle.DocumentViewStyle = DocumentViewStyle.SingleDocument;
NUIDocument doc = new NUIDocument();
doc.Client = new NameUC(); // a user control
doc.Client.Dock = DockStyle.Fill;
_manager.DocumentManager.AddDocument(doc);

NDockZone leftZone = new NDockZone(Orientation.Horizontal);
leftZone.SizeInfo.PrefferedSize = new Size(600, 200);
NDockingPanelHost leftPanelHost = new NDockingPanelHost();
leftZone.AddChild(leftPanelHost);

NDockingPanel panel = new NDockingPanel();
panel.Text = "Asset Tree";
panel.Controls.Add(new DockingPanel()); // add a user control
leftPanelHost.AddChild(panel);

// if orientation is vertical zone always displays below the document
//if orientation is horizontal zone always displays to the left
// How do I get the zone to display to the top or left of the document?
_manager.RootContainer.RootZone.Orientation = Orientation.Vertical;
_manager.RootContainer.RootZone.AddChild(leftZone);



Similar Topics


Reading This Topic