Referencing items in a Tab Control

  • Thread starter Thread starter clifgriffin
  • Start date Start date
C

clifgriffin

Guest
Okay...this is driving me crazy. I have a text box named txtDisplay in a Tab Control named TabControl1 on page 2 named Tab2.

How do I reference it correctly from the code???

I keep getting a "Index and length must refer to a location within the string." error.

This is the code I'm currently using..

Private Sub DisplayText(ByVal t As String)
txtDisplay.AppendText(t)
End Sub

If I move the text box off of the tab control it works...

How do I properly reference the text box??

Thanks in advance!

Clif
 
Derek Stone said:
Visual Basic:
Me.txtDisplay.AppendText(t)

Thanks for the reply! Still doesn't work though. :(

I'm using the microsoft example of using tcp sockets with vb.net for a chat.

If I drag the text box off of the tab control...it works like a charm!

Clif
 
Without modifying any code I moved a TextBox on and off a TabPage. On either container the above code worked just fine. I have a feeling there's another error in your code somewhere.
 
Thanks for the reply. I finally got it fixed.

Are you the only one that replies to questions around here? :)

Seems like maybe some of these members are missing the concept of a message board.

Thanks for your assitance though.

Clif
 
We actually have quite an extensive group of users that help out on this forum. Unfortunately not many of them have had the chance to become comfortable with .NET. A few of us, including myself and divil, started developing in .NET long before Microsoft was making a big deal about it. We've been using .NET for 8 months now, while others are just being introduced to it.
 
Back
Top