Q&A

  • 스트링그리드에 버튼을 추가했는데, 버튼을 클릭했을때 이벤트를 어떻게 주는지요..?
procedure TForm15.FormActivate(Sender: TObject);
var Y : integer;
begin
  //스트링그리드에 버튼 만들기...
        for y := 1 to stringgrid1.rowcount - 1 do
        begin
                StringGrid1.Objects[2, y] := Tbutton.Create(StringGrid1);

                with Tbutton(StringGrid1.Objects[2, y]) do
                begin
                        Parent := StringGrid1;
                        BoundsRect := StringGrid1.CellRect(2, y);
                        Width := StringGrid1.ColWidths[2];
                        Height := StringGrid1.RowHeights[2];
                        Caption := ' 삭제 ';
                end;
  End;
end;
1  COMMENTS