Reputation: 1269
I have a SplitContainer and was wondering how I would go about setting a static size for both panels and prevent the user from having the ability to resize the panels. Would FixedPanel be the solution? From what I read, I don't think it is.
Upvotes: 25
Views: 20387
Reputation: 269
The title of this question is misleading. There are more than one correct answers that satisfy the title of this question, in spite of the chosen answer.
For clarification:
FixedPanel
is what you're looking for to have one panel keep its size when resizing the SplitContainer. According to the description in the Properties window:
FixedPanel
Indicates that a particular SplitContainer's Panel should remain fixed in size during resize events
IsSplitterFixed
is just a way to temporarily prevent the user from moving the splitter. The panels still resize in proportion to the SplitContainer's size.
Upvotes: 12
Reputation: 160
I am really curious why you would want to use split container if you don't want the user to resize it
However in case you want to prevent one of the panels from auto-resizing with the parent container
It is the "Fixed panel" property of Split container.
Upvotes: 4
Reputation: 31857
If you don't want to allow the user to resize the panels, do not use an SplitContainer.
Simply use panels, and add a 2px width panel to simulate the separator.
Then, you can change the size of the panels as you want in design mode, and the user will not be able to resize the panels.
Upvotes: 0
Reputation: 81620
I think you are just looking for the "IsSplitterFixed" property.
Upvotes: 43