trutkowski
Programmer
I have a problem with my program that I cannot pin to a logical error. There are no compiler warnings generated, and the code compiles. The problem lies somewhere in this constructor:
Images 2 and 3 have no issues. Image 1 however, despite displaying perfectly; is almost entirely insensitive to the clicks; only the very bottom few rows actually generate an 'OnClick' method. What could be causing the issue?
Code:
constructor TBar1.Create;
var i:integer;
begin
for i := 1 to 4 do
begin
Images[i] := TImage.Create(Form1);
Images[i].BringToFront;
Images[i].Parent := Form1;
Images[i].Top := 0;
Images[i].Height := 46;
end;
for i := 1 to 2 do
begin
Images[i].Left := (i-1)*179;
Images[i].Width := 179;
end;
for i := 3 to 4 do
begin
Images[i].Left := 358 + (i-3)*45;
Images[i].Width := 46;
end;
Images[1].Picture.LoadFromFile(GetCurrentDir()+'/Buttons/CategoryButton.bmp');
Images[2].Picture.LoadFromFile(GetCurrentDir()+'/Buttons/ExtraButton.bmp');
Images[3].Picture.LoadFromFile(GetCurrentDir()+'/Buttons/SettingButton.bmp');
Images[4].Picture.LoadFromFile(GetCurrentDir()+'/Buttons/SearchButton.bmp');
for i := 1 to 3 do
begin
Images[i].OnClick := Form1.ClickProc;
end;
end;
Images 2 and 3 have no issues. Image 1 however, despite displaying perfectly; is almost entirely insensitive to the clicks; only the very bottom few rows actually generate an 'OnClick' method. What could be causing the issue?