我可以轻松访问
ListBox
的 TComboBox
以在 OnEnter
事件中更改其样式属性,如下所示:
combo_box->ListBox->StylesData["shadow.Softness"] = TValue::From<float>(0.3 * magnify_ratio);
或者,取消选择所有项目:
for (int i = 0; i < combo_box->ListBox->Items->Count; i++)
combo_box->ListBox->ListItems[i]->IsSelected = false;
但是,如何对
ListBox
事件中 TComboEdit
的 OnPopup
执行相同操作?我收到一个错误:
[bcc32c错误]:'Fmx::Comboedit::TComboEdit'中没有名为'ListBox'的成员
尝试将
TComboEdit::Presentation
属性类型转换为 TStyledComboEdit
,然后使用 TStyledComboEdit::ListBox
属性。
static_cast<TStyledComboEdit*>(combo_box->Presentation)->ListBox->...