I've created a custom FireMonkey control, TMyButton, inheriting from TControl in Delphi. How can I make it so that when I drop a new TMyButton onto a form, its Text property automatically sets to "MyButton1", incrementing for each new instance ("MyButton2", "MyButton3", etc.) at design-time?
Here's a snippet of TMyButton:
type
TMyButton = class(TControl)
private
FText: string;
published
property Text: string read FText write FText;
end;
I'm looking for a way to automate unique Text values similar to default naming in the IDE. Any advice?