Get your expert hat on....
I've created a UserControl which inherits ContainerControl.
When I drop another control onto this control in design time view, I want to
rename the new control and have that new name appear in the properties window:
Public Class TankControl
Inherits System.Windows.Forms.ContainerContro
Private mySubControl As Control
Private Sub TankControl_ControlAdded(ByVal sender As Object, ByVal e As
System.Windows.Forms.ControlEventArgs) Handles MyBase.ControlAdded
'This only allows ONE control to live in the Tank at a time..
If Me.Controls.Count > 1 Then
Me.Controls(0).Dispose()
End If
e.Control.Dock = DockStyle.Right
mySubControl = e.Control
'Here is where I would like to rename the sub control:
mySubControl.Name = Me.Name + "_SubControl"
End Sub
End Class
When I use this TankControl, everything works great, except if I drop a
textbox onto it, the textbox is still named "TextBox1" I want it named
"TankControl1_SubControl"
Hope this is clear what I am asking, and I hope there is a solution...
Thanks in advance...
--
--Zorpie