Delphi Programming Tutorial #42 - Hint Counter
Loading...
1,730
Uploader Comments (codegearguru)
see all
All Comments (2)
-
some nice hints there, thanks mate :)
Loading...
A tip: when using + / - buttons, set the Tag property to 1 for the addition button, and -1 for the subtraction button, then set both buttons to the same OnClick event. Within the event code, add: Value := Value + TButton(Sender).Tag;
It reduces the code by a teeny bit.
I loved the Max() tip! I didnt know about that one and I've been programming in Delphi/Pascal for about 20 years now!
Thanks for all the videos you're doing. They're great!
GitarStu 3 years ago
I have used this tip many times in the past. You can do if Sender = bPlus then... Although I'm trying not to mess the code and user interface too much these days as it makes testing and later modification harder (although in this simple case I don't think it matters much).
codegearguru 3 years ago