<!--CodeS-->
type 
  TForm1 = class(TForm) 
    StringGrid1: TStringGrid; 
    procedure FormActivate(Sender: TObject); 
  private 
    { Private declarations } 
     procedure btnclick(Sender: Tobject); 
  public 
    { Public declarations } 
  end; 
procedure TForm1.btnclick; 
begin 
  showmessage(TButton(Sender).Name); 
end; 
procedure TForm1.FormActivate(Sender: TObject); 
var Y : integer; 
for y := 1 to 3 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 := ' 삭제 '; 
      onclick := btnclick; 
    end; 
  end; 
end;
<!--CodeE-->
 
위와같이 프로시저를 선언 하고 스트링그리드에 동적으로 버튼을 생성해서 넣었습니다.
버튼을 onclick 할때 btnclick 프로시저로 연결 시켰는데요..
 
아무리 클릭을 해도 이벤트를 안 타는건지 반응이 없네요.
 
Tbutton의 Parent를 Self로 바꾸면 반응을 하지만 그경우엔 폼에 그리게 되어 모양새가 이상합니다.
 
답변부탁드립니다.
			 
	
	
    
    
	
	
    
    
    
Mouse Down이나 Mouse Up이벤트를 이용해보세요...