Inforcer25 Inforcer25 - 1 year ago 84
HTML Question

(Delphi) Is it possible to change a label to whats in a .html file?

Is it possible to change a Label caption to what is in a

file? Lets say the
file contains
in it. Can I make the Label retrieve that and change its
to that value?

lbl1.caption :=;

Is it possible to do this?

Answer Source

TLabel cannot load content for you, whether that is from a file or a remote URL. You have to write your own code to retrieve the content yourself, and then you can assign it to the TLabel. For example:

// using the Indy TIdHTTP component...
lbl1.Caption := IdHTTP1.Get('');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download