Board index » delphi » Events on runtime created TPanel

Events on runtime created TPanel

Hi All,

How can I link 2 Events to a in Run-time created Panel.

This panel is being drawn by the mouse...
This works...

But i need some events to resize or click it it.

Please help me out.

Arie van Someren

 

Re:Events on runtime created TPanel


type
  TForm1=class(TForm)
  private
    MyPanel: TPanel;
    procedure OnPanelClick(Sender: TObject)
  end;
...
  MyPanel:=TPanel.Create(Self);
...
  MyPanel.OnClick:=OnPanelClick;
...
procedure TForm1.onPanelClick(Sender: TObject);
begin
  ShowMessage('Clicked on panel!');
end;
Quote
Arie van Someren wrote in message <82ld4s$ca...@news.telekabel.nl>...
>Hi All,

>How can I link 2 Events to a in Run-time created Panel.

>This panel is being drawn by the mouse...
>This works...

>But i need some events to resize or click it it.

>Please help me out.

>Arie van Someren

Re:Events on runtime created TPanel


Events are properties like others... so you if you know how to create
dynamically a panel and set some properties, you also know how to write
mynewpanel.onclick := mypanelclickevent; .... the latter is a method written
using the good event format (type. here for click, this is TnotifyEvent)....

--
Olivier Dahan
oda...@{*word*104}cable.fr
http://perso.{*word*104}cable.fr/stargate
Delphi 32b C/S Certified Engineer
Arie van Someren <impact_s...@Hotmail.com> a crit dans le message :
82ld4s$ca...@news.telekabel.nl...
: Hi All,
:
: How can I link 2 Events to a in Run-time created Panel.
:
: This panel is being drawn by the mouse...
: This works...
:
: But i need some events to resize or click it it.
:
: Please help me out.
:
: Arie van Someren
:
:
:
:
:

Other Threads