How can I find out an address of a WinControl?
If the WinControl (e.g. a button) has been dropped on the Form1 at designtime it works like a charm.
But if I dynamically create a button then it doesn't.
Is there any way how to find out the address of the dynamically created Control?
If the WinControl (e.g. a button) has been dropped on the Form1 at designtime it works like a charm.
But if I dynamically create a button then it doesn't.
Is there any way how to find out the address of the dynamically created Control?
Code:
addr := form1.FieldAddress('Button1'); // <--- WORKS! addr = C0493C, Button1 was put onto Form1 at DESIGN time
b := TButton.Create(form1);
b.Name := 'mybutton';
b.parent := Form1;
addr := form1.FieldAddress('mybutton'); // addr = NIL. Why?