Jump to content


Photo

VB.net TabControl - Accessing individual text boxes within tabs


  • Please log in to reply
No replies to this topic

#1 timdav83

timdav83

    Young Padawan

  • Members
  • Pip
  • 17 posts

Posted 08 August 2010 - 01:06 AM

Most of my google searches led to using the foreach loop to loop through a series of text boxes within a tab control. This is not what I'm after. Since I need to perform calculations depending upon which text box is altered within a tab control, I need to access it individually.

Example 1 - Single Tab Control:
Attached File  tabex1.JPG   32.33KB   6 downloads

Example 2 - Multiple Tab Control:
Attached File  tabex2.JPG   39.79KB   5 downloads

In example 2, the first text box is named TextBox1 and second is TextBox2 by default. I need to perform something like:

'TabPage3
	Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
		'do something
		'alter labels on TabPage4
		'alter labels on TabPage2
	End Sub
	'TabPage3
	Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
		'do something
		'alter labels on TabPage4
		'alter labels on TabPage2
	End Sub

I copied a bunch of text boxes from a form into a tabcontrol and the project no longer functions which is why I've made the post.

Edited by timdav83, 08 August 2010 - 01:22 AM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users