在表格节目中,我将皮肤添加到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;
但它似乎不起作用。
烦。
答案 0 :(得分:4)
您可以检查组合框中是否已有皮肤名称:
if (cxBarEditItem2.Properties as TcxComboBoxProperties).Items.IndexOf(
cxLookAndFeelPaintersmanager.Items[i].lookandfeelname) = -1 then
(cxBarEditItem2.Properties as TcxComboBoxProperties).Items.Add(
cxLookAndFeelPaintersmanager.Items[i].lookandfeelname)