Нет кода, нет помощи. Поделюсь первым.
var
LV:PControl;
Th:PThread;
function OnDrawItem( P:Pointer; Sender: PObj; DC: HDC; const Rect: TRect; ItemIdx: Integer;
DrawAction: TDrawAction; ItemState: TDrawState ): Boolean ;
var
R:Trect;
i:integer;
begin
R:=Rect;
FillRect(DC,R, CreateSolidBrush(ClWhite));
for i:=0 to Pcontrol(Sender).Count-1 do
begin
R:=Pcontrol(Sender).LVSubItemRect(ItemIdx,i);
if i=0 then begin
R.Right:=Pcontrol(Sender).LVColWidth[i];
Inc(R.Left,40);
end;
DrawText(DC,Pchar( Pcontrol(Sender).LVItems[ItemIdx,i]),
Length(Pcontrol(Sender).LVItems[ItemIdx,i]),R,
DT_SINGLELINE or DT_LEFT or DT_NOPREFIX or DT_VCENTER or DT_WORD_ELLIPSIS);
end;
if odsFocused in ItemState then
InvertRect(DC,Rect);
Result:=True;
end;
function LVAdd(Sender:PThread):integer;
var
i:integer;
begin
for i:=1 to 50 do begin
LV.LVItemAdd('Строка #'+int2str(i)) ;
LV.LVItems[I-1,1]:='Строка #'+int2str(i) ;
end;
end;
procedure ShowForm(); stdcall;
var
F:Pcontrol;
begin
Applet:=newapplet('');
f:=NewForm(Applet,'');
LV:=NewListView(F,lvsDetailNoHeader,[lvoOwnerDrawFixed],nil,nil,nil);
LV.LVItemHeight:=40;
LV.LVColAdd('1',taLeft,150);
LV.LVColAdd('2',taLeft,150);
LV.SetAlign(caClient);
LV.OnDrawItem:=TonDrawItem(makeMethod(nil,@OnDrawItem));
Th:=NewThreadAutoFree(nil);
Th.OnExecute:=TOnThreadExecute(MakeMethod(nil,@LVAdd));
Th.Resume;
run(applet);
end;
exports
ShowForm name 'ShowForm';
begin
end.