August 22nd, 2007, 04:15 PM
Join Date: Aug 2007
Time spent in forums: 4 m 7 sec
Reputation Power: 0
Is it possible to access a component properties with a string variable !?
I am trying to find a way to access components properties with string variable... for example :
strComponent := 'ComboBox1';
strClass := 'TComboBox';
NewRef := FindComponent(strComponent) as FindClass(strClass);
NewRef.Visible := False;
... but FindClass() returns a TPersistentClass value! Huh, I don't know if it is possible to do what I am trying to do, but if somebody does have an idea please share it with me!
If U ask why!? I had an idea to store components names and some propertie values in a database so I can reconfigure, say a form, in a runtime! It is so easy to do this in some C language, there has to be a way in Delphi as well!