1,
DBComboBox1.Items.Delete(DBComboBox1.Items.IndexOf('超级用户'));
DBComboBox1.Items.Insert(0, '超级用户');
2,
for lp := 0 to DBComboBox1.items.count - 1 do
begin
if DBComboBox1.items[lp] = '超级用户'then
begin
DBComboBox1.items.Delete(lp);
break;
end;
end;
DBComboBox1.Items.Insert(0, '超级用户');
3
var
i:integer;
begin
Table1.first;
i := 1;
While not Table1.eof do
begin
if Table1.fieldByName('Name').asstring = '超级用户'then
begin
DBComboBox1.Items.Insert(0, Table1.fieldByName('Name').asstring);
end
else
begin
DBComboBox1.Items.Insert(i, Table1.fieldByName('Name').asstring);
i := i + 1;
end;
Table1.next;
end;
end;
Sorry!失礼!应是
if dbcombobox.items.indexof('超级用户') > 0 then
begin
dbcombobox.items.delete(dbcombobox.items.indexof('超级用户'));
dbcombobox.items.insert(0, '超级用户');
end;
Sorry!就是
if dbcombobox.items.indexof('超级用户') > 0 then
begin
dbcombobox.items.delete(dbcombobox.indexof('超级用户'));
dbcombobox.items.insert(0, '超级用户');
end;