Board index » delphi » How to Assign event handlers to objects(components) created at run time
sjs74n...@hotmail.com
![]() Delphi Developer |
Sat, 22 Jul 2000 03:00:00 GMT
|
sjs74n...@hotmail.com
![]() Delphi Developer |
Sat, 22 Jul 2000 03:00:00 GMT
How to Assign event handlers to objects(components) created at run timeI am creating objects like buttons etc at run time in my form, i also Procedure Tform1.Formcreate; btn := Tbutton.create(form1); { how do i attach my code to the button click of btn } end; Procedure Mycodeforbtnclick; -------------------==== Posted via Deja News ====----------------------- |
Sven Opit
![]() Delphi Developer |
Sat, 22 Jul 2000 03:00:00 GMT
Re:How to Assign event handlers to objects(components) created at run timesjs74n...@hotmail.com schrieb in Nachricht Quote>Procedure Tform1.Formcreate; Viel Spa? noch |
Christian R. Conr
![]() Delphi Developer |
Sat, 22 Jul 2000 03:00:00 GMT
Re:How to Assign event handlers to objects(components) created at run timeOn Tue, 3 Feb 1998 14:06:28 -0000, Quote> sjs74n...@hotmail.com schrieb: Just make sure that "MyCodeForBtnClick" is of the correct type: Procedure MyCodeForBtnClick(Sender: TObject); Am einfachsten schoepft man diese Prozedure dadurch dass man sie erst im The easiest way to create these procedures is to let the Object Christian R. Conrad |
Mark Vaugh
![]() Delphi Developer |
Sun, 23 Jul 2000 03:00:00 GMT
Re:How to Assign event handlers to objects(components) created at run timeQuoteIn article <886506680.1130692...@dejanews.com>, sjs74n...@hotmail.com wrote: ]-want to assign code to the event click of the button, created at run ]-time. so that when the user clicks the button my code should run. how do ]-i do it ? ]- ]- ]-Procedure Tform1.Formcreate; ]-begin ]- ]-btn := Tbutton.create(form1); ]- ]-{ how do i attach my code to the button click of btn } ]- ]- ]-end; ]- ]-Procedure Mycodeforbtnclick; ]-begin ]- { my code to run on btn click } ]-end; make Mycodeforbtnclick a method of some object...it's probably Procedure Tform1.Mycodeforbtnclick; then for more info, search the on-line help for "method pointers" Mark Vaughan |
Eugene V. Mishur
![]() Delphi Developer |
Mon, 31 Jul 2000 03:00:00 GMT
Re:How to Assign event handlers to objects(components) created at run timeQuotesjs74n...@hotmail.com wrote: Procedure TMyType.Mycodeforbtnclick(Sender : TObject); or Procedure TForm1.Mycodeforbtnclick(Sender : TObject); Procedure Tform1.Formcreate; btn := Tbutton.create(form1); btn.OnClick := FMyObject.Mycodeforbtnclick; Quote} Best regards, |
Dragos Iulia
![]() Delphi Developer |
Tue, 01 Aug 2000 03:00:00 GMT
Re:How to Assign event handlers to objects(components) created at run timesjs74n...@hotmail.com wrote in article Quote> I am creating objects like buttons etc at run time in my form, i also btn.OnClick:=Mycodeforbtnclick; ( you know that events are in fact properties of the components you're I hope this helped you! |
Christian R. Conr
![]() Delphi Developer |
Tue, 01 Aug 2000 03:00:00 GMT
Re:How to Assign event handlers to objects(components) created at run timeOn 13 Feb 1998 14:23:57 GMT, Quote> sjs74n...@hotmail.com wrote in article his procedure -- it's of the wrong type, isn't it? [MUNCH events are properties] Quote> You should keep in mind that your handler should have Procedure Mycodeforbtnclick(Sender: TObject); Quote> I hope this helped you! thread, on c.l.p.d.a.) about the stupidity of the questions people ask: Haven't these people ever generated a button-click event-handler in the Christian R. Conrad |
1. How to assign event handlers at run time?
2. Assigning event handlers at run-time
3. Compile error when trying to assign event handler to dynamically created object
4. Assigning event handlers to dynamicaly created objects
5. Assigning an event handler to dynamically created component?
6. How can I assign my event handler function of the dynamicaly created vcl component
7. Assigning Event Handlers for dynamically created components
8. Help creating Event-handlers at Run Time
9. Q: how to attach event handlers to run-time created controls