C:\Users\Public\Documents\RAD Studio\12.0\Samples\FireMonkeyMobile\ListView
路径下有两个dpk,装完后listview也能实现listbox的效果了
procedure TFormMain.FillListBox;
var
// item:TMetropolisUIListBoxItem;
// listitem:TListboxItem; p: PpatientData;
LItem: TListViewItem;
i: Integer;
begin
ListViewPatient.Items.Clear;
if not cdspatientlist.Active then
Exit;
ListViewPatient.BeginUpdate;
try
with cdspatientlist do
begin
DisableControls;
try
i := ;
First;
while not Eof do
begin
New(p);
p.patient_id := FieldByName('patient_id').AsString;
p.admiss_times := FieldByName('admiss_times').AsInteger;
p.inpatient_no := FieldByName('inpatient_no').AsString;
p.bed_no := FieldByName('bed_no').AsString + '床';
p.nurse_level := FieldByName('nurse_level').AsString;
p.diag := FieldByName('diag').AsString;
p.name := FieldByName('name').AsString;
p.sex := FieldByName('sex').AsString;
p.age := FieldByName('age').AsString;
p.charge_total := FieldByName('charge_total').AsString;
p.yue := FieldByName('yue').AsString; LItem := ListViewPatient.Items.Add;
LItem.Text := p.bed_no; LItem.Data[TMultiDetailAppearanceNames.Detail1] := '姓名 :' + p.name;
LItem.Data[TMultiDetailAppearanceNames.Detail2] := '护理等级:' +
p.nurse_level;
LItem.Data[TMultiDetailAppearanceNames.Detail3] := '诊断 :' + p.diag; if p.sex = '女' then
LItem.BitmapRef := (Image1.MultiResBitmap.Items[].Bitmap)
else if p.sex = '男' then LItem.BitmapRef := (Image1.MultiResBitmap.Items[].Bitmap); if p.sex = '' then
LItem.BitmapRef := Image1.MultiResBitmap.Items[].Bitmap
else
LItem.BitmapRef := Image1.MultiResBitmap.Items[].Bitmap; Inc(i);
Next; end;
finally
EnableControls;
end; end;
finally
ListViewPatient.EndUpdate;
end; end;