Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用组合框,我想禁用用户编辑,因此,我将 ComboBox 的 Style 属性设置为 csDropDownList 并且我想设置文本字段以启用默认选择。我该怎么做?
(用于 borland c++ builder bcb6)
谢谢!
您需要设置ItemIndex属性,其中
ItemIndex
-1 表示未选择任何项目
0、1、2、3 等将选择该索引处的项目。
如果由于某种原因,您还需要恢复文本(有时不同的 BCB 版本的行为不同),那么您还需要将Text属性设置为TStrings Items... 中的一个(由 索引ItemIndex)。
Text
TStrings Items