R
Rob
I have created a user control that has several buttons on it.....
The code below appears to add an instance of this user control to the Flow
Layout Panel just fine...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim aUnit As New MyUserControl
FlowLayoutPanel1.Controls.Add(aUnit)
End Sub
However when I run the following code... it tells me that all the user
controls have the same name in the same container (even though the location
is changing).
I know that this should not be possible. What am I doing wrong ? How can
I access a specific instance of my user control within the Flow?
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim ctrl As Control
For Each ctrl In FlowLayoutPanel1.Controls
MsgBox(ctrl.Name)
MsgBox(ctrl.Location.Y)
Next
End Sub
The code below appears to add an instance of this user control to the Flow
Layout Panel just fine...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim aUnit As New MyUserControl
FlowLayoutPanel1.Controls.Add(aUnit)
End Sub
However when I run the following code... it tells me that all the user
controls have the same name in the same container (even though the location
is changing).
I know that this should not be possible. What am I doing wrong ? How can
I access a specific instance of my user control within the Flow?
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim ctrl As Control
For Each ctrl In FlowLayoutPanel1.Controls
MsgBox(ctrl.Name)
MsgBox(ctrl.Location.Y)
Next
End Sub