Search code examples
delphidelphi-xe4livebindings

Can you make a live binding to a string variable in delphi xe 4


here is my problem: I have a label lblAccBalance and a variable in a different unit sAccBal:String. Is there a way that I can bind the caption of lblAccBalance to the value of my variable in my other unit with live bindings delphi xe4


Solution

  • you may add an extra thread polling the string var for example 4 times per second, and if it was changed - then posting event to main thread to do update. Or something like that. But the string is a passive element and does not have events, and thus LB has no way to hook into it and be notified of changes. You need to provide change notifications yourself.

    answer by Arioch 'The. read the comments