Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TListView DynamicAppearance TListItemText Selection color change Berlin


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Dec 4, 2016 12:30 AM Last Post By: Md. Shariful Al...
Md. Shariful Al...

Posts: 70
Registered: 9/9/01
TListView DynamicAppearance TListItemText Selection color change Berlin  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 3, 2016 10:50 PM
I have a TListView with DynamicAppearance. On run time I colored the TListItemText. On selection the item shows as Black color instead my color which I set run time. How can I remain it on my color on selecting the item? I also need ShowSelection.
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: TListView DynamicAppearance TListItemText Selection color change Berlin  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 3, 2016 11:34 PM   in response to: Md. Shariful Al... in response to: Md. Shariful Al...
Am 04.12.2016 um 07:50 schrieb Md. Shariful Alam Khan:
I have a TListView with DynamicAppearance. On run time I colored the TListItemText. On selection the item shows as Black color instead my color which I set run time. How can I remain it on my color on selecting the item? I also need ShowSelection.

Hello,

can you provide source code showing what you did exactly?

Greetings

Markus
Md. Shariful Al...

Posts: 70
Registered: 9/9/01
Re: TListView DynamicAppearance TListItemText Selection color change Berlin  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2016 12:30 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Am 04.12.2016 um 07:50 schrieb Md. Shariful Alam Khan:
I have a TListView with DynamicAppearance. On run time I colored the TListItemText. On selection the item shows as Black color instead my color which I set run time. How can I remain it on my color on selecting the item? I also need ShowSelection.

Hello,

can you provide source code showing what you did exactly?

Greetings

Markus
procedure AddListToListView(ListView: TListView;
fFriendId: string; ffriend_name: string; ffriend_image: string;
ffriend_status: Integer; fcountry: string; fusertype: string);
var
fclientid: string;
fcallbackid: string;
list: TListViewItem;
lusername: TListItemText;
lstatus: TListItemText;
lprofileimage: TListItemImage;
lstatusimage: TListItemImage;
lclientid: TListItemText;
lonline: TListItemText;
lcountry: TListItemText;
lusertype: TListItemText;
AFileExt: string;
bmp: TBitmap;
fMyFriendList: TMyFriendList;
begin
fclientid := '';
fcallbackid := '';
list := ListView.Items.Add;
lusername := list.Objects.FindObjectT<TListItemText>('username');
lstatus := list.Objects.FindObjectT<TListItemText>('status');
lprofileimage := list.Objects.FindObjectT<TListItemImage>('profileimage');
lstatusimage := list.Objects.FindObjectT<TListItemImage>('statusimage');
lclientid := list.Objects.FindObjectT<TListItemText>('clientid');
lonline := list.Objects.FindObjectT<TListItemText>('online');
lcountry := list.Objects.FindObjectT<TListItemText>('country');
lusertype := list.Objects.FindObjectT<TListItemText>('usertype');
lusername.Text := ffriend_name;
case fusertype.ToInteger of
1:
lusername.TextColor := TAlphaColorRec.Black; // black
2:
lusername.TextColor := TAlphaColorRec.Blue; // blue
3:
lusername.TextColor := TAlphaColorRec.Green; // green
4:
lusername.TextColor := TAlphaColorRec.Purple; // purple
5:
lusername.TextColor := StringToAlphaColor('#FFFE70FE');//TAlphaColorRec.Pink; // pink
6:
lusername.TextColor := TAlphaColorRec.Gold; // golden
7:
lusername.TextColor := TAlphaColorRec.Red; // red
else
lusername.TextColor := StringToAlphaColor('#1FFFFFFF');
end;
lcountry.Text := fcountry;
AFileExt := ExtractFileExt(ffriend_image);
AFileExt := AFileExt.Substring(Pos('.', AFileExt));
lusertype.Text := fusertype;
list.Data['id'] := fFriendId;
list.Tag := fFriendId.ToInteger;
list.Data['contenttype'] := AFileExt;
end;
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02