谁能帮我实现StringGrid的某列Cell具有下拉列表的功能。

senfore 2005-03-03 08:40:52
谁能帮我实现StringGrid的某列Cell具有下拉列表的功能。

不要那种使用combobox嵌入的方法,有现成控件也可以。
...全文
162 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
senfore 2005-03-04
  • 打赏
  • 举报
回复
有谁知道的支一声,急需呀,因为使用的多,所以每个都做的话就麻烦,有没有现成的控件呀~~~
senfore 2005-03-04
  • 打赏
  • 举报
回复
已经找到TMS.Component.Pack.Pro.v3.3中的TAdvStringGrid解决问题。还是非常感谢大家的回答。并向大家推荐这个控件,功能非常强,可以在StringGrid中整合combobox、checkbox、spinEdit等等。

TMS的控件是获得大奖的,呵呵,我就不多说了,我还没用上手呢。
bonniewater 2005-03-04
  • 打赏
  • 举报
回复
mark
mmkill 2005-03-04
  • 打赏
  • 举报
回复
用Tstrings封装一个属性就可以,很简单
勇者无敌_ 2005-03-04
  • 打赏
  • 举报
回复
这是我以前写的
procedure TFORM1.StringGridMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
GridCoord: TGridCoord;
Rect: TRect;
I: Integer;
begin
ComboBoxParamstr.Visible := False;
GridCoord := StringGrid.MouseCoord(X, Y);
FRow := GridCoord.Y;
FCol := GridCoord.X;
if (FRow <= 0) or (FCol < 0) then exit;
Rect := StringGrid.CellRect(FCol, FRow + 1);
ComboBoxParamstr.Text := StringGrid.Cells[FCol,FRow];
ComboBoxParamstr.Top := Rect.Top - 2;
ComboBoxParamstr.Left := Rect.Left + 10;
ComboBoxParamstr.Width := Rect.Right - Rect.Left;
ComboBoxParamstr.Visible := True;
case GridCoord.X of
0://字段
begin
ComboBoxParamstr.Items := FlstFields;
end;
1://字段类型
begin
ComboBoxParamstr.Visible := False;
//ComboBoxParamstr.Items := FlstFieldTypes;
end;
2://排序类型
begin
ComboBoxParamstr.Items := FlstOrdType;
end;
3://排序顺序
begin
ComboBoxParamstr.Clear;
for I := 1 to FMaxOrdNo do
ComboBoxParamstr.Items.Add(IntToStr(I));
ComboBoxParamstr.Text := StringGrid.Cells[FCol,FRow];
end;
4://关系
begin
ComboBoxParamstr.Items := FlstRelat;
end;
5://准则
begin
ComboBoxParamstr.Items := FlstRule;
end;
6://值
begin
ComboBoxParamstr.Items := FlstValue;
end;
end;
end;
dmyb7233 2005-03-04
  • 打赏
  • 举报
回复
ehlib
  • 打赏
  • 举报
回复
ehlib
caiso 2005-03-04
  • 打赏
  • 举报
回复
顶一下
gwhdaxia 2005-03-03
  • 打赏
  • 举报
回复
用combobox挺方便的啊
Stiven_PFan 2005-03-03
  • 打赏
  • 举报
回复
我看只能使用combobox嵌入的方法了,除非使用第三方控件封装了的。
飞天揽月 2005-03-03
  • 打赏
  • 举报
回复
mark

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧