CheckBox.Text = X... CheckBoxes Text stays Blank C# -
i parse xml document , need, 2 strings (y , z).
work fine. when add string z checkbox text.. text stays blank , checkbox no words.
list<string> extens = new list<string> { }; string xmlpath = path.getdirectoryname(assembly.getexecutingassembly().location) + "/extraex.xml"; public exten() { initializecomponent(); } private void exten_load(object sender, eventargs e) { if (file.exists(xmlpath)) { xmldocument xml = new xmldocument(); xml.load(xmlpath); xmlnodelist xnlist = xml.selectnodes("/extras/add"); foreach (xmlnode xn in xnlist) { string y = xn["checked"].innertext; string z = xn["exten"].innertext; //shows string value! messagebox.show(z); checkbox cb = new checkbox(); //cb.text still stays blank? cb.text = z; flayout.controls.add(cb); } } else { messagebox.show("xml file not exist!"); } }
try this
cb.text = "fixed value";
if text still not shown, make sure checkbox set visible , fits form/windows size
if text shown problem related how z being read file can try cb.text = y;
if text shown sure node exten not exist or contains value need show
and if of above fails call
this.refresh() ;
Comments
Post a Comment