TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Adam
NA
1
0
SplitContainer Dynamic Sizing
Sep 6 2009 7:58 PM
Hi,
I have a windows form that has nested split containers that are dynamically created. This is done by a recursive method.
That works just fine. However, if I were to try to set the splitterDistance to 50, it would take up about 400 pixels on the screen and it would keep getting smaller with each... (Like matryoshka dolls)
Does anyone have an idea of whats going on and how i can fix it?
Method that makes the splitcontainers
private void buildContainer()
{
scCollection.Panel1.Controls.Clear();
if (columns.Count == 1)
{
scCollection.Panel1.Controls.Add(columns[0]);
}
else
{
scCollection.Panel1.Controls.Add(giveMeColumn(0, columns.Count));
}
}
private SplitContainer giveMeColumn(int current, int max)
{
SplitContainer newCol = new SplitContainer();
newCol.Panel1.Controls.Add(columns[current]);
if (current < max - 2)
{
newCol.Panel2.Controls.Add(giveMeColumn(current + 1, max));
}
else
{
newCol.Panel2.Controls.Add(columns[current + 1]);
}
newCol.SplitterDistance = 100;
//newCol.Dock = System.Windows.Forms.DockStyle.Fill;
newCol.Height = scCollection.Panel2.Height;
newCol.Width = 300;
newCol.BorderStyle = BorderStyle.FixedSingle;
newCol.Orientation = Orientation.Vertical;
newCol.Panel1.AutoScroll = true;
return newCol;
} "columns" is a array of panel objects
Reply
Answers (
0
)
How to insert Access data in more than three tables from the “datagridview” control?
Convert .xml to .doc