.net - Why controls inside a UserControls are accessable from outside the usercontrol? -


I have a text box that contains UserControl, when I place this usercontrol on a form and all the controls I can see A loop creates control in the usercontrol along with the usercontrol, which means that the text box is located inside the user control is still accessible from the outside of the user control library

My problem began when I Want to list all the controls in a form (Including child control in a TabControl or GroupBox) I found that my UserControls are also behaving as part of the control form control inside, my code here

  Sub GetAllControls (Obj As the object, ByRef is in control list (of control) as for each thief Obj.Controls Controls. Add as control (thief) as, then con.HasChildren GetAllControls (Thief, Control) Next End Sub Private sub frmPHASE_Load (as the object, in the form of e EventArgs Handle MyBase.Load Dim ls as the new list (Control) me.GetAllControls (Me, ls) String = "String =" "as control for each C as L. C = St. Android; C.Name & amp; "," Next if the Saint & lt; & Gt; "" Then St. = St.Substring (0, St.Length - 1) MsgBox (St.) End Sub  


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -