1.
procedure TForm1.ComboBox5Click(Sender: TObject);
begin
//
showmessage('hello');
end;
怎么单击它没反应啊?
2.
我想选出表中的 合同ID 并把它加到 ComboBox5的items中
query1.close;
Query1.SQL.Clear;
Query1.SQL.Text:='SELECT 合同ID FROM dbo.xinyuluru1 Dbo_xinyuluru1';
下一步该怎么办? ComboBox5Click没反应,该写到什么事件中?
procedure TForm1.ComboBox5Click(Sender: TObject);
begin
//
showmessage('hello');
end;
怎么单击它没反应啊?
2.
我想选出表中的 合同ID 并把它加到 ComboBox5的items中
query1.close;
Query1.SQL.Clear;
Query1.SQL.Text:='SELECT 合同ID FROM dbo.xinyuluru1 Dbo_xinyuluru1';
下一步该怎么办? ComboBox5Click没反应,该写到什么事件中?
解决方案 »
- 请问各位高手
- 一个关于.txt文件,帮帮忙!!!1
- 好困惑!!ADO连接数据库,打包后在win2000和win98下面都能运行正常,但打包到XP上总是运行不了,说找不到文件(好象是msjet40.dll),原贴没人回
- 在StringDrid中添加數據時,如果防止不能添加同樣的一行?
- 真的没有高手能解决这个连打问题吗???太急
- 在Delphi7中如何使用XP的窗体?
- ADOQuery 怎么取出从存储过程里传回来的值呀?????
- 如何做数据的备份与恢复功能啊???
- 怎么让窗体上TabOrder=0的Edit获得输入焦点
- 关于stringgrid的问题?????
- 请问哪位大大能提供将cd转换mp3或wav格式的免费控件或方法
- 请教actionmanager组件的用法:
//关键是我不知道怎么得到选出的记录
query1.first;
while not query1.eof do]
begin
combobox1.items.add(query1.fieldvalues[]);
query1.next;
end;
以上可以帮你实现第二个,地一个,你得添加item
[Error] qyxy1.pas(248): Expression expected but ']' found
[]中应该添什么?
下面写法对不对?
query1.close;
Query1.SQL.Clear;
Query1.SQL.Text:='SELECT 合同ID FROM dbo.xinyuluru1 Dbo_xinyuluru1';
query1.open;
query1.first;
while not query1.eof do
begin
combobox5.items.add(query1.FieldValues[] );
query1.next;
end;
Select事件里写ShowMessage('Select');
CloseUp事件里写ShowMessage('CloseUp');
2.query1.close;
Query1.SQL.Clear;
Query1.SQL.Text:='SELECT 合同ID FROM dbo.xinyuluru1';
query1.open;
query1.first;
while not query1.eof do
begin
combobox5.items.add(query1.FieldByName('合同ID').AsString );
query1.next;
end;
Var
NewID: Integer;
Begin
NewID:= StrToInt(Combobox5.Text);
...//在这里写入处理 NewID 的代码.
End;至于如何将"合同ID"添加到 Combobox,上面的朋友已经说得很清楚.但如果你不想一开始就加载,可以在 OnDropDown 事件里写如下代码;
Procedure Form1.Combobox5DropDown(Sender: TObject);
Begin
IF Combobox5.Items.Count<>0 then Exit;
query1.close;
Query1.SQL.Text:='SELECT 合同ID FROM dbo.xinyuluru1';
Try
query1.open;
while not query1.eof do
begin
combobox5.items.add(query1.FieldByName('合同ID').AsString );
query1.next;
end;
Except
End;
End;
End;
query1.close;
Query1.SQL.Clear;
Query1.SQL.Text:='SELECT 合同ID FROM dbo.xinyuluru1';
query1.open;
query1.first;
while not query1.eof do
begin
combobox5.items.add(query1.FieldByName('合同ID').AsString );
query1.next;
end;
procedure TForm1.ComboBox5Select(Sender: TObject);
begin
//
showmessage('hello');
end;
/////////////////////////
2
query1.close;
Query1.SQL.Clear;
Query1.SQL.Text:='SELECT 合同ID FROM dbo.xinyuluru1 Dbo_xinyuluru1';
Query1.Open;
ComboBox1.Clear;
while not Query1.Eof do
begin
ComboBox1.items.add(query1.FieldByName('合同ID').AsString );
end;
procedure TForm1.ComboBox5Click(Sender: TObject);
begin
//
showmessage('hello');
end;
可能是你把事件沒有加到ONCLICK中去吧。
2.
我想选出表中的 合同ID 并把它加到 ComboBox5的items中
query1.close;
Query1.SQL.Clear;
Query1.SQL.Text:='SELECT 合同ID FROM dbo.xinyuluru1 Dbo_xinyuluru1';
combobox5.clear;
with query1 do
begin
while not eof do
begin
combobox5.items.add(fieldbyname().asstring);
next;
end;
close;
end;