I am using TImage control inside TScrollBox control in Delphi 4. Here i am populating data in TImage control by increasing the height accordingly.
My functionality is based on the mousedown event where i am using X, Y parameters to do some validations with highlighting that record.
Now issue here is X, Y are integer type parameters, and they return values in between -32768 to 32767. I am facing issues when my records are going beyond 32767 height. Mousedown event is returning Y value as negative causes issues with my functionality.
There are 2 possible ways to resolve this issue,
Any workaround to fix this issue.
Using another inbuilt component of Delphi 4 as an replacement.
I know one dirty approach (may be this is also not correct but working as of now) as mentioned below, but i am looking for better solution.
if Y < 0 then
begin
Y := Y + 65536;
end
else
begin
if ScrollBox1.VertScrollBar.Position > 32767 then
Y := Y + 65536;
end;
Please advice a better solution to this problem