c# - Get content of all user controls from a flow layout panel -


i have user control has label , text box. text box gets values dynamically @ run time. there n number of dynamic user controls added shown below:

for loop {    myusercontrol control = new myusercontrol();    control.setlabelvalue(label);    control.settextboxvalue(text);    flowlayoutpanel.controls.add(control); }  

flowlayoutpanel flow layout panel , setlabelvalue() , settextboxvalue() methods in user control class add value controls. lets in panel 10 such controls added. there way can value(text) of text boxes have been added?

thanks

use linq. substitute c.text whatever use @ value of 1 of myusercontrols:

list<string> values = new list<string>(); foreach (myusercontrol c in flowlayoutpanel.controls.oftype<myusercontrol>())     values.add(c.text); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -