Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends..

i use tab control i want to set the height and width of tab control acc0rding to form size..Its a window based application.. and tab control contains three tab page..so tab page also resize

how to handle Resize event of Form...



pls help me....
Posted
Comments
OriginalGriff 6-Sep-10 10:52am    
"pls give me code"
Try clicking on your tab control, and looking at the properties window. You don't need code to set the Dock or Anchor properties, you can do it at design time.
If you are experiencing the problem DaveyM69 described, (which I don't, so not sure what is going on there) then tell us, and we will see what we can recommend.
OriginalGriff 6-Sep-10 10:57am    
"i use panel. inside panel i put the tab control. tab control contains tab page.set the property of tab control
dock=fill.i want re size tab control and tab page...pls help me "
Have you docked or anchored the panel? Because if not, that will not re-size when the form changes...

1 solution

Why? Use the Anchor property and it will re-size / re-possition automatically. Use the Dock property and it can fill the container - so when that changes, so will the tab.
The same properties will work for your tab page contents.
 
Share this answer
 
Comments
DaveyM69 6-Sep-10 10:37am    
I've had issues with this in the past, the active TabPage resizing but not repainting properly when using Anchor or Dock. Maybe this is what the OP is getting at?
Edit: I've just checked:
1. The page doesn't resize on Maximize.
2. When Minimizing the size is reduced but when restoring from the task bar it doesn't resize. Talk about buggy!
OriginalGriff 6-Sep-10 10:42am    
I haven't seen that problem, so I just tried it with one of my apps. Works fine so far, but I notice that two controls aren't anchored - on the bug list now - so thanks: I might not have spotted that without your comment :thumbsup:
amitthakkar1987 6-Sep-10 10:51am    
i use panel. inside panel i put the tab control. tab control contains tab page.set the property of tab control
dock=fill.i want re size tab control and tab page...pls help me
Toli Cuturicu 6-Sep-10 12:30pm    
You have been helped. In fact you have been given the whole solution.

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