是否可以从选定的 TMetropolisUIListBoxItem 的标题、副标题或描述属性中提取字符串?

Is it possible to extract a string from a selected TMetropolisUIListBoxItem's Title, Subtitle or Description properties?

我正在创建一个使用 Metropolis UI 列表框项目的应用程序,我想通过单击按钮将所选项目的描述参数传输到备忘录。在常规列表框项目中,很容易提取文本字符串,例如:

procedure TForm1.Button1Click(Sender: TObject);

begin
    Memo1.Text := ListBox1.Selected.Text;
      end;

这也适用于 Metropolis UI 列表框项目的文本 属性,正常情况下。 但是,如果我对 Title、Subtitle 或 Description 属性尝试同样的操作,它就是行不通。

procedure TForm1.Button1Click(Sender: TObject);

begin
    Memo1.Text := ListBox1.Selected.Description;
      end;

有谁知道我怎样才能按照我想要的方式在这些属性上使用字符串?

如果将列表框项转换为大都市列表框项,您可以访问这些属性。

procedure TForm1.Button1Click(Sender: TObject);
var
  lbItemSel: TListBoxItem;
begin
  lbItemSel := ListBox1.Selected;
  if (lbItemSel is TMetropolisUIListBoxItem) then
  begin
    Memo1.Text := 
     TMetropolisUIListBoxItem(lbItemSel).Title + ' ' +
     TMetropolisUIListBoxItem(lbItemSel).SubTitle + ' ' +
     TMetropolisUIListBoxItem(lbItemSel).Description
     ;
  end;
end;