?
Solved

Split container, how do you specify panel widths?

Posted on 2008-10-06
7
Medium Priority
?
4,772 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

765 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