procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
var
Rect : TRect;
Org : TPoint;
begin
with TStringGrid(Sender) do
begin
Perform(WM_CANCELMODE,0,0);
Rect:=CellRect(Acol,ARow);
Org:=Self.ScreenToClient(ClientToScreen(Rect.TopLeft));
With Combobox1 do
begin
Setbounds(org.X,org.Y-(Rect.Bottom-Rect.Top),Rect.Right-Rect.Left,Height);
ItemIndex:=Items.IndexOf(Cells[ACol,ARow]);
Show;
BringTofront;
SetFocus;
//DroppedDown := True;
end;
end;
end;
以上會有當StringGrid 捲動scroll 而錯位的問題~我是在event觸發onTopLeftchange把他做隱藏的動作,我想因該可以再把Top left算出來重新定位...
還有combobox在declaration時不能宣告在parent為StringGrid會有不能展開列表的問題
end;
星期四, 4月 10, 2008
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言