Click here to Skip to main content
15,922,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to resize a particular column, so want a code should also resize the complete table layout panel accordingly.
So include the code for tablelayout panel too in relation to columnsize with the below mousemove event.

Please help in my below code....

Code:
C#
private void tableLayoutPanel1_MouseMove(object sender, MouseEventArgs e)
{
    if (resizing)
    {
        if (rbColumn.Checked)
        {
            columnStyles[GColumn].SizeType = SizeType.Absolute;
            columnStyles[GColumn].Width += e.X  - columnStyles [GColumn ].Width    ;
        }
    }
}
Posted
Updated 2-Dec-11 2:58am
v2
Comments
Sander Rossel 2-Dec-11 8:58am    
Added pre tags around the code block.
Scubapro 2-Dec-11 9:27am    
Your question is somewhat cryptic. Do you mean that if you resize this particular column, that all others columns should be resized to the same size?
srinivasan_indian 2-Dec-11 9:32am    
No. If i resize specific column, that is resizing perfectly. But all the next columns are also resizing. I want to resize only the specific column.
Scubapro 2-Dec-11 10:04am    
This is only the case if the other columns are of sizetype percent or autosize. If the other columns sizes are set to absolute, you won't have this problem.
BillWoodruff 3-Dec-11 17:35pm    
What have you done to calculate the width resize required for the TableLayoutPanel so far ?

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