Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.05.16;
Скачать: CL | DM;

Вниз

Кнопочка в StringGrid   Найти похожие ветки 

 
killer ©   (2004-04-28 22:40) [0]

Добавляю кнопочку в ячейку StringGrid-а... она добавляется... все хорошо... но почему не работает событие по нажатию на нее?
Делаю я так:

unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls, Grids, Buttons;

type
 TForm1 = class(TForm)
   StringGrid1: TStringGrid;
   Button1: TButton;
   procedure Button1Click(Sender: TObject);
   procedure BitBtnClick(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
with TBitBtn.Create(StringGrid1) do
 begin
 Parent:=StringGrid1;
 BoundsRect:=StringGrid1.CellRect(4, 1);
 OnClick:=BitBtnClick;
 end;
end;

procedure TForm1.BitBtnClick(Sender: TObject);
begin
ShowMessage("Test");
end;

end.


 
Гаврила ©   (2004-04-28 23:13) [1]

на первый взгляд, все правильно


 
killer ©   (2004-04-28 23:17) [2]

я тоже так думаю......... :)))))))) Но не работает что то.......


 
killer ©   (2004-04-29 01:24) [3]

сделал ShowMessage("Test"); на событие OnMouseUp... вроде заработало... а теперь как определить на какой строке была нажата кнопка?



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

Текущий архив: 2004.05.16;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.065 c
1-1083426139
Viner
2004-05-01 19:42
2004.05.16
Возможность вставки рисунков


3-1082189318
Koba
2004-04-17 12:08
2004.05.16
База данных


1-1083149096
pavel_guzhanov
2004-04-28 14:44
2004.05.16
как сделать ocx?


1-1083000926
Leonardo_de_caprio
2004-04-26 21:35
2004.05.16
Как ПРАВИЛЬНО останавливать Treadы в Delphi?


14-1082387404
Polevi
2004-04-19 19:10
2004.05.16
задачка