Solved

Split container, how do you specify panel widths?

Posted on 2008-10-06
7
3,639 Views
Last Modified: 2012-05-05
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?
0
Comment
Question by:mhouldridge
  • 3
  • 2
7 Comments
 
LVL 18

Accepted Solution

by:
Priest04 earned 250 total points
Comment Utility
Set spliContainer's FixedPanel property to Panel1, and sets Panel1MinSize to 250.

Goran
0
 
LVL 14

Assisted Solution

by:CyrexCore2k
CyrexCore2k earned 250 total points
Comment Utility
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
 
LVL 18

Expert Comment

by:Priest04
Comment Utility
I disagree, my solution is tested, and it works,

Goran
0
 
LVL 14

Expert Comment

by:CyrexCore2k
Comment Utility
Mine works too.
0
 
LVL 18

Expert Comment

by:Priest04
Comment Utility
Yes, your works too, with one addition: you also need to set FixedPanel property to Panel1, since when resizing, Splitterdistance also changes.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now