Re: how to make the HTML source show in memo?
Posted: Sat Jun 15, 2019 7:03 pm
Hi,
Use the TChromium.OnTextResultAvailable event in your form.
Call TChromium.RetrieveHTML and you will receive the HTML source in the "aText" parameter found in the TChromium.OnTextResultAvailable event.
Save the "aText" value in a class field called "FMyStringField" and later you can assign it to your memo like this :
Most TChromium events are executed in a different thread. This can cause problems if you create, destroy or modify VCL controls inside those events.
To be safe, store the information you need from those events and send a message to the main form to handle the VCL controls in the main thread.
In this case, it's safer to assign "aText" to "FMyStringField" and send a custom message to the main form to assign FMyStringField to the memo lines.
Use the TChromium.OnTextResultAvailable event in your form.
Call TChromium.RetrieveHTML and you will receive the HTML source in the "aText" parameter found in the TChromium.OnTextResultAvailable event.
Save the "aText" value in a class field called "FMyStringField" and later you can assign it to your memo like this :
Code: Select all
Memo1.Lines.Text := FMyStringField;
To be safe, store the information you need from those events and send a message to the main form to handle the VCL controls in the main thread.
In this case, it's safer to assign "aText" to "FMyStringField" and send a custom message to the main form to assign FMyStringField to the memo lines.