Home > Mobile >  Delphi: how to identify which panel called Form2
Delphi: how to identify which panel called Form2

Time:02-12

I have 16 TPanels on Form1 and OnDblClick event they call Form2 ( form2.Show; ). working with Form2, I want to know, which of panel(TPanel name) have called Form2

PS: using Tag property can identify tag number, but I need edit1.text to show the name of panel

CodePudding user response:

Several possible solutions.

One of then is to add a string property to Form2 and set the value of the panel OnDblClick event before calling Form2.Show.

Another one is the create a new function in Form2 that takes a string argument which is the panel name, save that value to a form's field and call Show. From the panel's OnDblClick, call the function instead of Show, passing the panel's name.

  • Related