Click here to Skip to main content
15,905,144 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 checkedlistbox on form. How can I resize them according to form size while form resizing.
Posted

1. In the form add a splitcontainer control -> set its docking to fill.

2. Place one split control in the Left side panel and set it docking to right and set the cursor to default and disable it.

3. Place one split control in the right side panel and set it docking to Left and set the cursor to default and disable it.

4. now place the list boxs in both panels and set the docking to fill then you will get what you wanted.

Hope this may help.
Thanks.
 
Share this answer
 
Comments
CHill60 24-Jan-13 6:17am    
Nice one ...my +5. And for googlers if you need more controls than this just put the splitcontainer into a panel
Peter Felix A 24-Jan-13 9:16am    
Thanks.
Ravndra22 25-Jan-13 5:05am    
Thnx Peter Felix A
You need to change the Anchor property (in Design) e.g. To Top, Bottom, Left, Right

If the controls are in a panel you will also need to do this to the Panel (it will need to resize as well)

Depending on the positioning of the controls you may get some overlapping when the form is resized - in which case you need to play about with MinimumSize and MaximumSize properties of the form and/or checkedListBox

Anything else you want to do when the form is resized could be added to the
C#
private void Form1_Resize(object sender, EventArgs e)
event
 
Share this answer
 
v2
Comments
Ravndra22 24-Jan-13 0:04am    
Its possible for single list. Bt I can't set this for two list in same panel. Plz any other solution
CHill60 24-Jan-13 4:17am    
Yes it is - see improved Solution 1
It is posible if I had single list. bt I have two and I can't set this prperty for two list in same panel
 
Share this answer
 
Comments
CHill60 24-Jan-13 4:18am    
Do not post comments as a Solution - use the Have a Question or Comment? button or click the Reply link to a comment

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900