如题。
解决方案 »
- 请教各位,fastreport如何在一页纸上打印多个不同的stringgrid?
- 请问有没有办法得到给Adoquery 中SQL 变量赋值后的sql。急。。。
- 交流mapinfo电子地图数据!!
- 请问各位高手一个简单的问题,如何在listview加入已经设定好的一些数据组,但不要是从数据库里拿出来的
- 多层系统中 多个人同时操作同一个数据表时,中间层就死机了。
- 疑惑!!调用windows API KERNEL32.DLL函数的问题。
- TListBox如何实现鼠标拖动,使其Items[]的内容变换位置
- 请大家来讨论一下:关于程序控制的问题
- D版确实要换主子了。
- 大家好!!sql怎么样限制显示第十条至二十条记录的问题的问题!!!!
- 用sql语句来select 记录问题!
- 老婆中午没有做饭家里只有啤酒喝充饥散分
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
begin
if (gdFocused in State) then
begin
if (Field.FieldName = DBComboBox1.DataField ) then
begin
DBComboBox1.Left := Rect.Left + DBGrid1.Left;
DBComboBox1.Top := Rect.Top + DBGrid1.top;
DBComboBox1.Width := Rect.Right - Rect.Left;
DBComboBox1.Height := Rect.Bottom - Rect.Top;
DBComboBox1.Visible := True;
end;
end;
end;procedure TForm1.DBGrid1ColExit(Sender: TObject);
begin
If DBGrid1.SelectedField.FieldName = DBComboBox1.DataField then
begin
DBComboBox1.Visible := false;
end;
end;procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if (key <> chr(9)) then
begin
if (DBGrid1.SelectedField.FieldName =DBComboBox1.DataField) then
begin
DBComboBox1.SetFocus;
SendMessage(DBComboBox1.Handle,WM_Char,word(Key),0);
end;
end;
end;
设置好Datasoure和DataFiel后
双击WwDBGrid,弹出的窗体中添加Fields
再在对应的Field中设置EditControl页中的Control Type为CustomEidt
Control Name为wwDBCombobox就行啦