Dynamically set up CAPTION of Label on each form with XML

zhaozj2021-02-16  35

XML definition

program:

Procedure loadLabelcaption (Indestr: String; Form: TForm); Var i: integer; c: integer; j: integer; begin c: = form.componentcount; for i: = 0 To c-1 do beginiff.components [i ] IS TLABEL THEN Begin Xml.Active: = false; xml.active: = true; if Xml.childNodes.findNode ('hint'). ChildNodes.FindNode (Indestr) <> nil dam for j: = 0 TO XML. ChildNodes.FindNode ( 'Hint'). ChildNodes.FindNode (IndeStr) .ChildNodes.Count-1 do begin if Form.Components [i] .Name = XML.ChildNodes.FindNode ( 'Hint'). ChildNodes.FindNode (IndeStr) .Childnodes [j] .NodeName THEN TLABEL (form.components [i]). CAPTION: = Xml.childNodes.FindNode ('hint'). ChildNodes.FindNode (Indestr) .childnodes [j] .text; end; end; End; end;

转载请注明原文地址:https://www.9cbs.com/read-20706.html

New Post(0)