gpt4 book ai didi

delphi - 防止皮肤名称在我的 dxBarCombo1 中重复

转载 作者:行者123 更新时间:2023-12-03 02:08:53 25 4
gpt4 key购买 nike

在表单上显示我正在向 dxBarCombo1 添加外观。

for I := 0 to cxLookAndFeelPaintersmanager.Count -1 do
begin
if (cxLookAndFeelPaintersmanager.Items[i].lookandfeelname <> 'UltraFlat')
and (cxLookAndFeelPaintersmanager.Items[i].lookandfeelname <> 'Flat')
and (cxLookAndFeelPaintersmanager.Items[i].lookandfeelname <> 'Standard')
and (cxLookAndFeelPaintersmanager.Items[i].lookandfeelname <> 'Native')
and (cxLookAndFeelPaintersmanager.Items[i].lookandfeelname <> 'Office11')
then begin
dxBarCombo1.Items.Add(cxLookAndFeelPaintersmanager.Items[i].lookandfeelname) ;
(cxBarEditItem2.Properties as TcxComboBoxProperties).Items.Add(cxLookAndFeelPaintersmanager.Items[i].lookandfeelname);
end;

隐藏和显示主窗体只是不断地再次添加相同的皮肤,因此我在组合中得到了很多重复项。

我必须写什么才能保证这些皮肤不会一直被添加?

我尝试在表单关闭上清除组合:

dxBarCombo1.Items.Clear;

但似乎不起作用。

烦人。

最佳答案

您可以检查皮肤名称是否已在组合框中:

if (cxBarEditItem2.Properties as TcxComboBoxProperties).Items.IndexOf(
cxLookAndFeelPaintersmanager.Items[i].lookandfeelname) = -1 then
(cxBarEditItem2.Properties as TcxComboBoxProperties).Items.Add(
cxLookAndFeelPaintersmanager.Items[i].lookandfeelname)

关于delphi - 防止皮肤名称在我的 dxBarCombo1 中重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41782337/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com