Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How to get the inital property values in a component constructor?
I'm writing a color button component. The backgound color will be adjustable, and it will display a bitmap, and this bitmap changes to an another bitmap, while the button is down.
The component works fine. When I assign a bitmap to the Image property, at design time, it appeares on the surface of the button, because the property calles the SetImage procedure. But when I run the application, the image only shown after the first button click. In this case, the button is created, but the SetImage procedure will not run. The Delphi assigns the data to my Image property like Image.Date = .......
I'v tried to get the image data in the constructor, but that time it does not exist.
I would appriciate any help.
0 · ·