Procedure TLogin.Com boBox1DropDown (Sender: TObject);
Var
I: integer;
The begin
Adoquery1. Close;
Adoquery1. SQL. The Clear;
Adoquery1. SQL. The Add (' select name from user list);
Adoquery1. Open;
While not adoquery1. Eof do
The begin
Combobox1. Items. The Add (adoquery1 fieldbyname (' name '). AsString) are identical.
Adoquery1. Next;
end;
end;
The question now is in the database only sys a user, but a combobox per click will increase the sys user options,
CodePudding user response:
Add combobox1. Items. The Clear;
Procedure TLogin.Com boBox1DropDown (Sender: TObject);
Var
I: integer;
The begin
Combobox1. Items. The Clear;
Adoquery1. Close;
Adoquery1. SQL. The Clear;
Adoquery1. SQL. The Add (' select name from user list);
Adoquery1. Open;
While not adoquery1. Eof do
The begin
Combobox1. Items. The Add (adoquery1 fieldbyname (' name '). AsString) are identical.
Adoquery1. Next;
end;
end;
CodePudding user response:
Drop down box upstairs to the user name can also be placed in the DropDown can not eventsCodePudding user response:
This is a question of code is repeated many times,Suggestions in the From. OnCreat event, to join the above code, the code executed only once,
CodePudding user response:
Personally, I suggest don't under the DropDown can events, such as really need to. Please add combobox1 Items. The Clear;CodePudding user response: