Link to home
Start Free TrialLog in
Avatar of xanthe
xanthe

asked on

Setting typed properties at runtime?

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.
Thanks,
Xanthe
ASKER CERTIFIED SOLUTION
Avatar of Igor UL7AAjr
Igor UL7AAjr
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xanthe
xanthe

ASKER

Brilliant!  I see however, that the question I asked was not as straight forward as I had thought.  You will notice that I said that the actual application was not to do with colour but with a custom component I have written, I see now that I will have to modify the code I have written for this component to allow it to have a function to change between a string and a TArrowType(a thing I use in my component)....although how I do that - no idea?!  Anyway, I'll have a try and thanks again for your help and your quick response!
Xanthe