Page 1 of 1

Auto refresh the caption with GetTextOrDefault()

Posted: Tue Nov 18, 2008 3:31 am
by manielan
Hi Experts,
I'm creating buttons during run time whose captions are retrieved from database. I use GetTextOrDefault() to display the correct language text during the creation. But when the user change the language, all those created during design time are reflecting the correct text except those created at runtime. Do I have to scan the whole form for run time components and change the caption? is there any automated way?

Regards
Elan

Posted: Tue Nov 18, 2008 11:10 am
by isiticov
Hello,

Yes, the only way to achieve this is to scan the components and re-apply the caption to them. You can easily create a procedure for this, that will iterate through all the components in Components property of the form and re-apply the caption there.