title: How to access to the properties of an UserControl from code side?
body: <p>make my own UserControl and I can aggregate new TabPages to a TabControl and then, inside of then TabPage, I add my own UserControl using the following code.</p>
  
  <pre><code> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim TabX As New Windows.Forms.TabPage("Tab " &amp; TabCount.ToString) '(ConfiguracionTabPage)
      Dim MyControl As New ClientesEmpresa
      MyControl.Name = "Control" &amp; TabCount.ToString
  
      If ClientesTabControl.TabPages.Count = 10 Then
          ClientesTabControl.TabPages.RemoveAt(9)
      End If
      TabX.Controls.Add(MyControl)
  
      TabX.Name = "Tab" &amp; TabCount.ToString
      TabX.Text = "Tab" &amp; TabCount.ToString
  
      MyControl.TitularLbl.Text = "Coca Cola"
  
      Me.ClientesTabControl.TabPages.Insert(0, TabX)
      Me.ClientesTabControl.SelectedIndex = 0
      TabCount += 1
  End Sub
  </code></pre>
  
  <p>My user control have several Labels, TextBox and TabPages(inside of a TabControl).</p>
  
  <p>Now I want to change some properties dynamically from the source code, but I don't know how to access them.
  The most similar theme that I found is this <a href="https://stackoverflow.com/questions/411316/how-to-access-properties-of-a-usercontrol-in-c-sharp">How to Acces of an User control in c#</a>, but, as the title says, is in C#, how I can do it in VB.NET?</p>
  
  <hr>
  
  <p>Sorry, I just notice that the Enter  key post the comment. :(</p>
  
  <p>Thanks for your feedback, I understand what are you saying but I missing something in the middle.</p>
  
  <p>When I create the control in running time in the above code I can access easily to the properties of the created object, in this case my UserControl, but I don't understand how to reach the properties of a particular instance of that control from outside of Button_Click; ie. another button_click event(second button)</p>
  
  <p>I was thinking to use something like</p>
  
  <pre><code>Dim ControlList As Windows.Forms.Control() = Me.ClientesTabControl.TabPages(0).Controls.Find("ModeloLbl", True)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ClientesTabControl.TabPages(0).Controls.OfType(Of AlarmasVehiculo)()
  </code></pre>
  
  <p>But I'm stuck here.</p>
  
  <p>------------------------------------- 3th post ---------------</p>
  
  <p>Thanks Steve, I was resolved using "Control.Find" and a For Each but your solution is easier.</p>
  
  <p>There's any way to get the name of the selected tab or I must to create an Array when I create the New TabPage?, the idea is to update the text of the controls inside of the selected tab only when is selected by the user or every 5 seconds but just the in selected one.</p>
  
  <p>Thanks.</p>