procedure TForm1.FileListBox1Change(Sender: TObject);var msg : TMSG ; i: integer; //nIndex : integer; begin for i := 1 to 4 do begin Tedit(findcomponent('Edit'+inttostr(i))).text := ''; end; for i :=1 to filelistbox1.count do begin filelistbox1.ItemIndex := i-1; TEdit(findcomponent('Edit'+inttostr(1))).text :=filelistbox1.FileName; if(CheckBox1.Checked)then begin TImage(findcomponent('Image'+inttostr(1))).picture.LoadFromFile(filelistbox1.filename); end else begin TImage(findcomponent('Image'+inttostr(1))).picture.LoadFromFile('d:\blank.jpg'); end; while(PeekMessage(msg,Self.WindowHandle,0,0,PM_REMOVE)) do begin TranslateMessage(msg); DispatchMessage(msg); end; end;end;不好意思忘了给代码了。
msg : TMSG ;
i: integer;
//nIndex : integer;
begin
for i := 1 to 4 do
begin
Tedit(findcomponent('Edit'+inttostr(i))).text := '';
end;
for i :=1 to filelistbox1.count do
begin
filelistbox1.ItemIndex := i-1;
TEdit(findcomponent('Edit'+inttostr(1))).text :=filelistbox1.FileName;
if(CheckBox1.Checked)then
begin
TImage(findcomponent('Image'+inttostr(1))).picture.LoadFromFile(filelistbox1.filename);
end else begin
TImage(findcomponent('Image'+inttostr(1))).picture.LoadFromFile('d:\blank.jpg');
end;
while(PeekMessage(msg,Self.WindowHandle,0,0,PM_REMOVE)) do
begin
TranslateMessage(msg);
DispatchMessage(msg);
end; end;end;不好意思忘了给代码了。