Split container, how do you specify panel widths?

Experts,

I've added a simple splitcontainer control, which has been set to vertical split, and fill.

I'd like to set the width of the left panel to 250px, is this possible?
mhouldridgeAsked:
Who is Participating?
 
Priest04Connect With a Mentor Commented:
Set spliContainer's FixedPanel property to Panel1, and sets Panel1MinSize to 250.

Goran
0
 
CyrexCore2kConnect With a Mentor Commented:
Unfortunately you can't set the panel directly:

mySplitContainer.Panel1.Width = 250

You can however change the SplitterDistance value:

spltHorizontal.SplitterDistance = 250;

However the splitter has some padding and whatnot so you'll have to adjust accordingly. It'll probably be something close to

spltHorizontal.SplitterDistance = 252;
0
 
Priest04Commented:
I disagree, my solution is tested, and it works,

Goran
0
 
CyrexCore2kCommented:
Mine works too.
0
 
Priest04Commented:
Yes, your works too, with one addition: you also need to set FixedPanel property to Panel1, since when resizing, Splitterdistance also changes.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.