Why are the controls in the wrong place if they are located while scrolling the form?

Consider this form labeled “Observer here” and the 'Click' button:

a label near the left edge of the form, with a button

When I click the button, I set the label Leftto 10 ( Label1.Left :=10;)

I get it right, as in the second image:

form with label near left edge

Then I scroll the form to the right:

same form as before, but scrolled right so label is hidden

Now, after clicking the button, I get a problem, which is shown in the 4th image:

same form, scrolled left, but label visible near middle instead of left

The label is Leftno longer 10. It's over 10, but I need it to be 10. How can I do this?

+5
source share
1 answer

Label1.Left: = 10; 10 (form1.left).

Label1.Left: = 10; , Form1.HorzScrollBar.Position ;

Label1.Left := 10 - Form1.HorzScrollBar.Position  ;

, 1 , ,

HorzScrollBar, , , 1 , , , , form1 not

+6

All Articles