如何找到 FMX TSearchBox

huangapple go评论94阅读模式
英文:

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

TSearchBoxMobileControls 示例 中是 TListBox 的子组件。您可以通过右键单击 TListBox,然后选择 Add ItemTSearchBox 来添加它。

如果您查看定义 TSearchBoxFMX.SearchBox 单元,您会看到它实现了 IListBoxHeaderTrait 接口。它似乎可以在 TListBox 之外工作,但如果您查看代码,您也可以轻松创建自己的版本。

有趣的是,TSearchBoxListBox's Item Editor 对话框中缺失,其他项也有大约一半缺失。

如何找到 FMX TSearchBox

英文:

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 ItemTSearchBox.

如何找到 FMX 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...

如何找到 FMX TSearchBox

huangapple
  • 本文由 发表于 2023年7月6日 17:52:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76627584.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定