[DUG] Changing Font in a multi line list box (Firemonkey)

Vik Vasudev vikas.image at gmail.com
Fri Feb 15 10:52:57 NZDT 2013


Thanks Jason,

I will try this solution.

On Fri, Feb 15, 2013 at 10:50 AM, jason at software-solutions.co.nz <
jason at software-solutions.co.nz> wrote:

> You will have to create a new listbox style, that has two TText objects in
> it, one aligned to top and one client, then assign this to the StyleLookup
> of the listitems as you add them. Also create an event handler to the
> OnApplyStyleLookup event of each item and in this event find the resources
> (Text objects) and assign the  values.****
>
> ** **
>
> I myself subclass the TListBoxItem object, create my own text objects in
> the create event, and provide properties for the Name and Address, much
> cleaner, then use this new subclass when creating the listviewitem objects.
> ****
>
> ** **
>
> Jason****
>
> ** **
>
> *From:* delphi-bounces at listserver.123.net.nz [mailto:
> delphi-bounces at listserver.123.net.nz] *On Behalf Of *Vik Vasudev
> *Sent:* Friday, 15 February 2013 10:31 a.m.
> *To:* NZ Borland Developers Group - Delphi List; NZ Borland Developers
> Group - Delphi List
>
> *Subject:* [DUG] Changing Font in a multi line list box (Firemonkey)****
>
> ** **
>
> Hello Everyone ****
>
> ** **
>
> Is there anyway i can have multiple font for multiline text on a listbox
> items.****
>
> ** **
>
> For instance****
>
> ** **
>
> I have text   FirsName Last Name****
>
>                   Address****
>
> ** **
>
> I want Address to have different font.****
>
> ** **
>
> Dummy Code****
>
> ** **
>
> //****
>
>   TClientDetail   = Record****
>
>      FCln_Ref        : Int64;****
>
>      FCln_FirstName  : string;****
>
>      FCln_LastName   : string;****
>
>      FFullName       : string;****
>
>      FCoName         : String;****
>
>      FAddress        : string;****
>
>    end;****
>
> ** **
>
>   TClientList   = class (TListBoxItem)****
>
>      public****
>
>        FCln_Detail   : TClientDetail;****
>
>   end;****
>
> ** **
>
> ** **
>
>   lClnobj                            :=  TClientList.Create (Listbox)****
>
>   lClnobj.FCln_Detail.FFullName         :=
> lClnobj.FCln_Detail.FCln_FirstName****
>
>                                                 +' '+
> lClnobj.FCln_Detail.FCln_LastName;****
>
> ** **
>
>   lClnobj.FCln_Detail.FAddress          :=  FGlobalRWqry.FieldByName****
>
>                                                     (Fld_Address).AsString;
> ****
>
>   lClnobj.Text                                :=  lName + #13#10 +****
>
>
> lClnobj.FCln_Detail.FCoName+****
>
>                                                     #13#10 +****
>
>
> lClnobj.FCln_Detail.FAddress;****
>
>    lClnobj.Height := 40****
>
>    lClnobj.EndUpdate;****
>
>    listbox.AddObject (lClnobj);****
>
> ** **
>
> I am using #13#10 to make it look like Multiline but i am not sure how to
> i change the font of text in multiline****
>
> ** **
>
> ** **
>
> Appreciate your help ****
>
> ** **
>
> Thanks****
>
> Vikas****
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>



-- 
  vikas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20130215/6ae68f89/attachment.html 


More information about the Delphi mailing list