Setting typed properties at runtime?
Posted on 2001-07-25
Apologies if this question has already been asked somewhere but in that the search function is not fully operational I am unable to search extensively. Anyway, I need to set the properties of a label at runtime. eg. MyLabel.Font.Color
The information needed to set the colour is held in a string which is read in from a text file at runtime. The text in the string is clRed and I'm trying to use it while dynamically creating the label component. Delphi seems to complain about a type mismatch (TColor and string) and I'm not entirely sure how to get around it.
(Incidentally - it's not actually the colour of text that I'm trying to change, it's a custom component which I created myself and so this is an easier example to explain!)
Any ideas would be greatly appreciated.