Jump to content
Registration disabled at the moment Read more... ×
Sign in to follow this  
Salahdz

listview items width on run

Recommended Posts

hello, found

 

procedure TServiceBillform.listview_venteUpdateObjects(const Sender: TObject;
  const AItem: TListViewItem);
var Tex : Tlistitemtext;
begin
  Tex := AItem.View.FindDrawable('Text1') as tlistitemtext;
  Tex.Width:=listview_vente.width-147; // their is two button on the right of text 1
  // couldn't finde align layout listviewitems
end;

 

Share this post


Link to post

TListItemText has all properties for alignment; Align, VertAlogn; PlaceOffset

You better check FindDrawable before access, call me paranoid, but I never trust any FindXxx method

 

var
   Dwb : TlistItemDrawable;
...

Dwb := AItem.View.FindDrawable('Text1');
if Assigned( Dwb ) and ( Dwb is TlistItemText ) then
begin
    Text := Dwb as TlistItemText;
    ...
end;

 

Edited by Rollo62

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×