Profile Picture

nSplitter question

Posted By Miles Thornton 14 Years Ago
Author
Message
Miles Thornton
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 17, Visits: 1

I have an NForm with an (NTabPage) tabbed interface, on a NTabPage control I have a main NUIPanel containing: a set of NBands and another NUIPanel (docked) containing the splitter and a few more controls. On the first time the user goes to this tab I need the splitter to move to adjust the size and positions of the controls (tied to the resize event of the NUIPanel host – which the SplitterMoved(object sender, SplitterEventArgs e) event calls).

 

Resizing the NBands container and/or the Docked NUIPanel have no effect at all – Moving the splitter with the mouse works, so… I need to move the splitter!

 

Given the code behind the provided C# example application for the NSplitter control, I thought this would do it:

int lefty = (this.npnlFixturesMain.Width - (this.npnlFixturesMain.Width / 4));

this.SuspendLayout();

this.nSplitterFixtures.Location = new System.Drawing.Point(lefty, 0);

this.ResumeLayout();

But, clearly, I didn’t understand…

 

Can someone please point me to (or post) an example of how to programmatically move a splitter bar on a form?

 

Thank you!



Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hello Miles,

I will try to explain how the NSplitter control works:

Let's say that you have a form with 2 panels - one docked Left and the other Fill.

Also, you have NSplitter control which is also in the Form.Controls collection

this.Controls.Add(panel1);

this.Controls.Add(splitter1);

this.Controls.Add(panel2);

This way the splitter will stay between the panels.

The splitter should be docked at the same position as the panel that is Docked left

splitter.Dock = DockStyle.Left;

This way the splitter will be between both panels.

Now, if you reduce programmatically the width of one panel and increase the width of the other the splitter will move according the panels.

 



Best Regards,
Nevron Support Team



Miles Thornton
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 17, Visits: 1

So I need to resize the panels; I can't move the splitter? Hmmm... Ok, that's easy enough to implement; but it seems like a workaround to me on something that should be a splitter method for consistancy's sake if nothing else.

Thank you for the reply and the advice; I'll just resize the panels then.

-Miles





Similar Topics


Reading This Topic