Something is not clear for me, if I have winform and on that form add one label. Label is possible to move, form is scroll able.
On every move I'm update position of label in database. When again open form x and y is loading from database and label should have same position like before closing. What is the problem ? The problem is if scroll moving label on position 1000 of x , that is saved on db, but when I open again form, label is not on that position, label is somewhere on beginning of form.
Why ?
Sorry on my bad English.
some code:
private void lb_MouseDown(object sender, MouseEventArgs e) { isDragging = true; clickOffsetX = e.X; clickOffsetY = e.Y; } private void lb_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (isDragging == true) { Label lb = (Label)sender; lb.Left = e.X + lb.Left - clickOffsetX; lbr.Top = e.Y + lb.Top - clickOffsetY; } } } private void lb_MouseUp(object sender, MouseEventArgs e) { lb.Location = new Point(lb.Location.X, (ro * itemHeight) + y); strip.X = lb.Location.X; stripsForUpdate.Add(strip); } private void frmTest_Load(object sender, EventArgs e) { for(int i=1;i<=strips.Count;i++) { lb.Location = new Point(strips[i-1].X,150); } }