英文:
How to find FMX TSearchBox
问题
我在Delphi 11中有一个多设备FMX项目。我想在一个窗体上添加一个搜索框,但在工具面板中找不到TSearchBox组件。文档确认了TSearchBox组件的存在。我正在使用WedgewoodLight样式(来自GetIt),其中包含与搜索框相关的样式(searchboxstyle、searcheditbutton、searchtoolbutton、searchtoolbuttonbordered),但当我将TEdit放置在窗体上时,编辑的StyleLookup选项中没有显示这些样式。
Controls示例应用程序在设计视图中包含一个TSearchBox组件。似乎我可以将其复制到剪贴板,但无法粘贴到我的项目中。
是否有一种方式可以在我的项目中可视化地添加TSearchBox?
谢谢。
英文:
I have a multi-device FMX project in Delphi 11. I would like to add a search box to a form, but I cannot find a TSearchBox component in the tool palette. The docs confirm that a TSearchBox component exists. I'm using the WedgewoodLight style (from GetIt) which contains search box related styles (searchboxstyle, searcheditbutton, searchtoolbutton, searchtoolbuttonbordered) but when I place an TEdit on a form none of those styles is displayed in the StyleLookup options for the edit.
The Controls sample app contains a TSearchBox component in a design view. It seems I can copy it to the clipboard but I cannot paste it into my project.
Is there a way to visually add a TSearchBox to my project?
Thanks
答案1
得分: 1
TSearchBox
在 MobileControls 示例 中是 TListBox
的子组件。您可以通过右键单击 TListBox
,然后选择 Add Item → TSearchBox 来添加它。
如果您查看定义 TSearchBox
的 FMX.SearchBox
单元,您会看到它实现了 IListBoxHeaderTrait
接口。它似乎可以在 TListBox
之外工作,但如果您查看代码,您也可以轻松创建自己的版本。
有趣的是,TSearchBox
在 ListBox's Item Editor 对话框中缺失,其他项也有大约一半缺失。
英文:
The TSearchBox
in the MobileControls sample is a child component of the TListBox
. You can add it by right clicking on a TListBox
and choosing Add Item → TSearchBox.
If you look in the FMX.SearchBox
unit, where TSearchBox
is defined, you will see it implements the IListBoxHeaderTrait
interface. It looks like it should work outside a TListBox
, but you could easily create your own version too of you look at the code.
Interestingly the TSearchBox
is missing from the ListBox's Item Editor dialog, as are about half of the other items...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论