Forum: Programmieren allgemein
by DeddyH,
1. Apr 2010
Mit einem else würde er dasselbe machen.if combobox1.items.Strings = 'DT' then
combobox1.Items.Delete(i)
else if combobox1.Items.Strings = 'YASU' then
combobox1.Items.Delete(i);
Forum: Programmieren allgemein
by DeddyH,
1. Apr 2010
Nein, BeginUpdate sorgt nur dafür, dass die Items während der Abarbeitung nicht neu gezeichnet werden, solange bis das entsprechende EndUpdate folgt.
Forum: Programmieren allgemein
by DeddyH,
1. Apr 2010
Funktioniert es denn so?i := 0;
repeat
if (combobox1.items.Strings = 'YASU') or (combobox1.Items.Strings = 'DT') then
combobox1.Items.Delete(i)
else
i := i+1;
a := combobox1.Items.Count;
until i >= combobox1.Items.Count;
Forum: Programmieren allgemein
by DeddyH,
1. Apr 2010
Dann würde ich das so machen:ComboBox.Items.BeginUpdate;
try
for i := ComboBox.Items.Count - 1 downto 0 do
if AnsiContainsText(ComboBox.Items,'yasu') or AnsiContainsText(ComboBox.Items,'dt') then
ComboBox.Items.Delete(i);
finally
ComboBox.Items.EndUpdate;
end;
Wo kommen denn die Beiträge auf einmal her? Außerdem ist eine repeat-Schleife hier nicht angesagt, da man evtl....
Forum: Programmieren allgemein
by DeddyH,
1. Apr 2010
Erst einmal gibt es keine if-Schleife. Und dann hab ich noch nicht ganz begriffen, was Du vorhast. Sollen alle Einträge gelöscht werden, die YASU oder DT an beliebiger Stelle enthalten?