Вниз
Скачать: CL | DM;

Stringgrid   Найти похожие ветки 

 
tytus   (2002-09-11 16:50) [0]

Подскажите, как сделать, чтоб при щелчке мышки на ячейке Stringgrid появлялся Combobox????


 
MBo ©   (2002-09-11 16:51) [1]

procedure TForm1.sg1SelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
var
R: TRect;
begin
if ARow =1 then begin
R := SG1.CellRect(ACol, ARow);
cb1.left := R.Left+ SG1.Left+1;
cb1.top := R.Top + sg1.top+1;
cb1.Width := sg1.ColWidths[acol];
cb1.Visible := True;
cb1.SetFocus;
end;
CanSelect := True;
end;

procedure TForm1.cb1Change(Sender: TObject);
begin
SG1.Cells[SG1.Col, SG1.Row]:=
cb1.Items[cb1.itemindex];
cb1.visible:=false;
end;

procedure TForm1.cb1Exit(Sender: TObject);
begin
cb1.visible:=false;
end;

procedure TForm1.sg1TopLeftChanged(Sender: TObject);
var
R: TRect;
begin
R := SG1.CellRect(SG1.Col, SG1.Row);
cb1.left := R.Left+ SG1.Left+1;
end;


 
Song ©   (2002-09-11 16:52) [2]

TStrinGrid.onClick --> TStringGrid.MouseToCell() --> TComboBox.Left/Top



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
1-73625
#Deus
2002-09-11 20:33
2002.09.23
Delphi 7


1-73739
SergLight
2002-09-10 15:46
2002.09.23
Custom Hint


4-73939
manton
2002-08-06 14:23
2002.09.23
Журнал событий


1-73612
sdram
2002-09-12 11:52
2002.09.23
OnSetText


3-73567
Bishop
2002-09-03 17:21
2002.09.23
Lookup




   Наверх