M
MS public
I'm trying to do something very simple, and I cant get it to work. Probably
last nights beero or possibly inherent stupidity on my part. Any how this
does not work. Any Ideas ? The PositionChanged event does not seem to fire
when I change the position of the bound Textbox.
TIA
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
myStrings(0) = "A"
myStrings(1) = "String"
myStrings(2) = "Array"
AddHandler Me.BindingContext(myStrings).PositionChanged, AddressOf
Me.onPositionChanged
End Sub
Private Sub onPositionChanged(ByVal Sender As System.Object, ByVal e As
System.EventArgs)
MessageBox.Show("Position Changed")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
TextBox1.DataBindings.Add("Text", myStrings, "")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.BindingContext(myStrings).Position += 1
End Sub
last nights beero or possibly inherent stupidity on my part. Any how this
does not work. Any Ideas ? The PositionChanged event does not seem to fire
when I change the position of the bound Textbox.
TIA
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
myStrings(0) = "A"
myStrings(1) = "String"
myStrings(2) = "Array"
AddHandler Me.BindingContext(myStrings).PositionChanged, AddressOf
Me.onPositionChanged
End Sub
Private Sub onPositionChanged(ByVal Sender As System.Object, ByVal e As
System.EventArgs)
MessageBox.Show("Position Changed")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
TextBox1.DataBindings.Add("Text", myStrings, "")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.BindingContext(myStrings).Position += 1
End Sub