Seems I may have found the err in my ways - and that does not make sense to me.
I had
Me.ucUserControl.Textbox1.text
and as soon as I remove the "Me." it worked !!
I have no idea why but I am sure there is some theory behind the madness in this one.
Just to give better feedback now that I can think straight again.
One can effective reuse UserControls after it has been cleared before e.g.:
Instead of the Global declaration (which I normally would do) I can now declare it almost anywhere in my code:
Private Sub GetData()
Dim ucMyControl As New _ucMyControl
With ucMyControl
.Dock = DockStyle.Fill
.Visible = True
End With
pnlMain.Controls.Clear
pnlMain.Controls.Add(ucMyControl)
ucMyControl.TextBox1.Text = ExternalForm.TextBox1.Text
End Sub
You can now reuse that user control anywhere else in your program after you have cleared it from the parent control.
Just remember, never to use "Me." when referring to the User Control.
Regards,
T
EDIT:
New snag!!!! Nothing makes sense at all!!
If I use
Me.ucMyControl.TextBox1.Text = ExternalForm.TextBox1.Text
then the Text Property of MyControl.TextBox has a value but it is not displayed.
If I use
ucMyControl.TextBox1.Text = ExternalForm.TextBox1.Text
then the
Text
Property of MyControl.TextBox has
NO value however it displays the correct information.
Even if I assign a value directly e.g:
ucMyControl.TextBox1.Text = "12345"
the value of "12345" is displayed but the value is not stored in the
Text
property of the control.
Any idea why this is happening ?