![]() |
|
التعامل مع listbox - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15) +--- الموضوع : التعامل مع listbox (/showthread.php?tid=11657) |
التعامل مع listbox - invocker - 22-11-2021 السلام عليكم قمت بمتابعة الشرح هنا [/url][url=https://www.experts-exchange.com/articles/10054/Implementing-a-ListView-in-Firemonkey.html]listbox وكل شيء تمام لكن عند الضغط على شريط التمرير scrollbar تختفي الصورة والبوتون فأين الخلل بارك الله فيكم هذا الكود المستعمل كود : Var
ListBoxItem: TListBoxItem;
ItemText: TText;
// if you get an error here, ensure that FMX.Objects is included in your uses above.
Itembtn: TSpeedButton;
ItemCircle: TCircle;
begin
// First, we create an empty ListBoxItem with no parent
ListBoxItem := TListBoxItem.Create(self);
// now, we set a parent for this item
// ListBox1.BeginUpdate;
ListBoxItem.BeginUpdate;
ListBoxItem.Parent := ListBox1;
ListBoxItem.Height := 113;
ListBoxItem.Width := 336;
// Associate the Style you created with the ListBoxItem - not the ListBox itself.
ListBoxItem.StyleLookup := 'NewList';
// Next up, we're going to populate ItemText with the Caption of the Style using a style name lookup.
ItemText := ListBoxItem.FindStyleResource('TxtUser') as TText;
// We're going to set the text of the object to be whatever the caption should be.
if Assigned(ItemText) then
ItemText.Text := 'Hello World!';
Itembtn := ListBoxItem.FindStyleResource('BtnAddFriend') as TSpeedButton;
// We're going to set the text of the object to be whatever the caption should be.
if Assigned(Itembtn) then
Itembtn.Text := 'Hello World!';
Itembtn := ListBoxItem.FindStyleResource('BtnRemove') as TSpeedButton;
// We're going to set the text of the object to be whatever the caption should be.
if Assigned(Itembtn) then
Itembtn.Text := 'Hello World!';
ItemCircle := ListBoxItem.FindStyleResource('Img') as TCircle;
// We're going to set the text of the object to be whatever the caption should be.
if Assigned(ItemCircle) then
ItemCircle.Fill.Bitmap.Bitmap.LoadFromFile('E:\badger_1f9a1.png');
ListBoxItem.EndUpdate;
TabControl1.ActiveTab := TabUsers;وهذه الصورة
RE: التعامل مع listbox - invocker - 22-11-2021
Project1.rar (الحجم : 56.78 ك ب / التحميلات : 30)
|