c# - Find a ListView control in tab page -


i have 2 listviews in tab page. looking function find right control name:

i have

foreach (control c in form.controls) // loop through form controls {     if (c tabcontrol)     {         tabcontrol f = (tabcontrol)c;          foreach (control tab in f.controls)         {             tabpage tabpage = (tabpage)tab;              foreach (control control in tabpage.controls)             {                 messagebox.show(control.name);                  // code go here             }         }          } } 

the controls collection has find function returns array:

control[] ctrls = this.controls.find("listview1", true); if (ctrls.length == 1) {   messagebox.show("found " + ctrls[0].name); } 

Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -