Controls added to panel are moving down when repainted

I have a Panel on a form to which i have added a selection of controls with (x,y) coordinates.

The panel has Autoscroll enabled. If there are enough controls to require a scrollbar, and the bar has been scrolled down when the paint event fires, the controls all move down when the panel paints.

Each time this process is repeated the controls are shuffled down. This results in a gap at the top of the panel : /

I have checked through debugging and the coordinates arent changing so the control is still at (25, 25) but now (25,25) is further down the panel : / Im really stumped on this one. Can anyone shed some light?

Can you post your code? This probably depends on the implementation of scrollbars in the panel

We should create a generic c# thread class in daniweb. that class will be inherited by all the threads and will add some common things that we keep repeating. for example, post your code, attach your application, mark as solved and such.
that will add these texts like a header to the thread, so as soon as the guy posted it, he will see all these and take the required action. How is that?

Sorry for late reply/solved, had no time at all over the weekend to look at this.

Like the idea serkan, im new to the board, i've always managed to resolve issues or just ignored them so im still gettin used to the requirements for posting problems :p A reminder when posting would be helpful haha

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...