Click here to Skip to main content
14,981,532 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
private void tableLayoutPanel1_MouseMove(object sender, MouseEventArgs e)
        {
           
            try
            {
                if (resizing)
                {
                    if (rbColumn.Checked)
                    {
                      
                    columnStyles[GColumn].SizeType = SizeType.Absolute;
                   columnStyles[GColumn].Width += e.X - columnStyles[GColumn].Width;

                    }

                }
                }
            
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString());
            }
        

        } 



Description:

Placed a panel and import its background image like Table(image) and BackColor as "Transparent". Then placed a tablelayoutpanel over the panel and set cellBorderStyle as "Single".

I just want to move specific columns in tablelayoutpanel during runtime.

With the help of my code, I am getting the column value during mouseclick event.

With the help of that value, I want to move the specific column during TableLayoutPanel_MouseMove event.(Mentioned above code)

If Value=2 means need to move only 2nd column. But its moving 3rd,4th column and so on....
Posted
Updated 1-Dec-11 15:15pm
v3
Comments
[no name] 1-Dec-11 8:28am
   
EDIT: added "pre" tag
[no name] 1-Dec-11 21:16pm
   
EDIT v3: added "code" tag
Yvan Rodrigues 1-Dec-11 8:30am
   
(Almost) Everything in C# is zero-indexed, so the first item has an index of 0. Is that the problem?
srinivasan_indian 1-Dec-11 8:36am
   
No. If i am having the GColumn values as 3, it is moving 3rd column. Thats fine. But its moving 4th,5th column also.

Want to move only 3rd column....
lukeer 1-Dec-11 9:53am
   
Please do not ask the same question again (and again and again and, you know what I mean). Use the original question's "Improve question" instead to provide new aspects or a better description.

1 solution

See my answer to your original question here[^].

And don't comment or answer here. Do it in the original thread.
   
v2

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