lol, how many times have you made this mistake ? it's very weird until you found why everything is going wrong :)
lol, how many times have you made this mistake ? it's very weird until you found why everything is going wrong :)
procedure TForm1.FormCreate(Sender: TObject);
var
Button: TButton;
begin
Button := TButton(Self);
Button.Parent := Self;
end:
procedure TForm1.FormCreate(Sender: TObject);
var
Button: TButton;
begin
Button := TButton(Self);
Button.Parent := Self;
end:
this mistake? never
ReplyDeletesimilar? forgot to set parent (;
Dorin Duminica All the time :-)
ReplyDeleteButton:=TButton.create;
ReplyDeleteI sure everyone that write a lot of code makes similar silly mistakes when tired.
ReplyDeleteI will counter with "how many times do I come into a tech forum thats is flagged as having a new tech post to find that it is not".
It took a half minute of my day to come and take a look at your post.
I want a refund.
let's open a "Delphi Developpers Discussion" group instead of a Discussion topic
ReplyDeletePaul TOTH You could name the community GSmiley
ReplyDeleteNever. Because I use safe cast.
ReplyDeleteЕвгений Савин its not a type cast, it's a typo
ReplyDeleteIt's a typo that is also a type cast .....
ReplyDeleteIf there just would be something like static code analyzers (or the compiler itself) that could find suspicious hardcasts ...
ReplyDeleteBeen there done that.
ReplyDeletePaul TOTH safe type cast raises exception on your code. Unsafe cast does not.
ReplyDeleteЕвгений Савин he meant to write button := TButton.Create(self);
ReplyDeleteThomas Mueller A!!!!!! Now I see. Thanks.
ReplyDelete