Stop splitter from scaling panels in C#?
Asked Answered
S

2

5

I have a SplitContainer with both panels filled.
When I resize it, tho, both panels scale equally so the splitter is at the same relative distance in the container.
I really need to block this feature. How do I do this?

Suckow answered 17/6, 2011 at 20:34 Comment(0)
S
15

Take a look at the FixedPanel property. You can then specify if you want Panel1 or Panel2 fixed. The three options are:

None (This is the default)

Specifies that neither SplitContainer.Panel1, SplitContainer.Panel2 is fixed. A Control.Resize event affects both panels.

Panel1

Specifies that SplitContainer.Panel1 is fixed. A Control.Resize event affects only SplitContainer.Panel2.

Panel2

Specifies that SplitContainer.Panel2 is fixed. A Control.Resize event affects only SplitContainer.Panel1.

Sharilyn answered 17/6, 2011 at 20:45 Comment(0)
P
2

You can use the FixedPanel Property of the splitter to specify wich panel will scale. By default it is set to None so both will scale.

Phillane answered 17/6, 2011 at 20:45 Comment(1)
Sorry but the other answer was 16 seconds quicker... You get the rep tho.Suckow

© 2022 - 2024 — McMap. All rights reserved.