Jump to content
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×