Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Split container, how do you specify panel widths?

Posted on 2008-10-06
7
Medium Priority
?
5,129 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 18

Accepted Solution

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

Goran
0
 
LVL 14

Assisted Solution

by:CyrexCore2k
CyrexCore2k earned 1000 total points
ID: 22652281
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
ID: 22946785
I disagree, my solution is tested, and it works,

Goran
0
 
LVL 14

Expert Comment

by:CyrexCore2k
ID: 22947647
Mine works too.
0
 
LVL 18

Expert Comment

by:Priest04
ID: 22948560
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

610 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