我想通过一个按钮控件往combobox里添加列表,程序如下:
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
InputString: string;
begin
InputString:= InputBox('添加NTP服务器', '网址/ip', '');
if trim(inputstring)<>'' then
begin
combobox1.Items.text:=inputstring;
combobox1.Text:=inputstring;
end
else
exit;
end;
不过这样不能将inputstring中的内容保存下来,如果我要把inputstring之中的内容保存在列表中,应如何实现?
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
InputString: string;
begin
InputString:= InputBox('添加NTP服务器', '网址/ip', '');
if trim(inputstring)<>'' then
begin
combobox1.Items.text:=inputstring;
combobox1.Text:=inputstring;
end
else
exit;
end;
不过这样不能将inputstring中的内容保存下来,如果我要把inputstring之中的内容保存在列表中,应如何实现?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货