Want splitcontainer panels width runtime

M

Morten Wennevik [C# MVP]

I am creating splitcontainer at runtime.. want width of panels different.
How can i do that.
As i cant modify splitContainer2 .panel2.width = 100;




From http://www.developmentnow.com/g/36_0_0_0_0_0/dotnet-languages-csharp.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

Well, the exception you get when you try to set panel2.Width tells you to use SplitterDistance instead. SplitterDistance will set the width of panel1, so if you want to set the width of panel2, set the SplitterDistance to SplitContainer.Width - X where X is the desired width of panel2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top