todonnell69
Member
- Joined
- Jun 8, 2005
- Messages
- 15
- Programming Experience
- 5-10
Given the following code...
Public Class Form1
Inherits System.Windows.Forms.Form
'Create array of vendor objects...
Dim maVendors(3) As Vendor
...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Init vendor array...
maVendors(0) = New Vendor("Microsoft")
maVendors(1) = New Vendor("Mac")
maVendors(2) = New Vendor("HP")
'Bind the array to the textbox...
txtVendorName.DataBindings.Add("Text", maVendors, "VendorName")
End Sub
Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
Me.BindingContext(maVendors).Position -= 1
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Me.BindingContext(maVendors).Position += 1
End Sub
End Class
What does the 'me' refer to in the 2 button click event handlers?
Sorry, I know this is probably stupid, but I can't get the word 'BindingContext' to enumerate for any of the controls.
TIA!
Public Class Form1
Inherits System.Windows.Forms.Form
'Create array of vendor objects...
Dim maVendors(3) As Vendor
...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Init vendor array...
maVendors(0) = New Vendor("Microsoft")
maVendors(1) = New Vendor("Mac")
maVendors(2) = New Vendor("HP")
'Bind the array to the textbox...
txtVendorName.DataBindings.Add("Text", maVendors, "VendorName")
End Sub
Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
Me.BindingContext(maVendors).Position -= 1
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Me.BindingContext(maVendors).Position += 1
End Sub
End Class
What does the 'me' refer to in the 2 button click event handlers?
Sorry, I know this is probably stupid, but I can't get the word 'BindingContext' to enumerate for any of the controls.
TIA!