W
Wan
Dear Group,
I have a small application with two buttons and three textboxes
with databinding.
One of the textboxes has a ¡§textchanged¡¨ event and other 2 textboxes
are attached with the same events. If I type into any textboxes then
btnSave and btnExit will enable/disable respectively. The problem is
that in some instances ¡¥text changed event¡¨ hits endless loop and
causes an stackoverflow message. Is there a way to solve this
problem? I¡¦d appreciate any help. Thanks
Private sub Form1_Activated (..)
¡K
Text1.Databindings.Add(New Binding(¡§Text¡¨, ds.tables(0), ¡§City¡¨)
Text2.Databindings.Add(New Binding(¡§Text¡¨, ds.tables(0), ¡§State¡¨)
Text3.Databindings.Add(New Binding(¡§Text¡¨, ds.tables(0), ¡§Zip¡¨)
Addhander Text1.TexChnaged, AddressOf Form1_TextChanged
Addhander Text2.TexChnaged, AddressOf Form1_TextChanged
Addhander Text3.TexChnaged, AddressOf Form1_TextChanged
End sub
Private sub Form1_TextChanged(..) Handles textbox1_TextChanged
Me.bindingCntact(ds).EndCurrentEdit() „² causes endless lop
If ds.HasChanged = True then
btnSave.Enabled = True ¡¥ enable save button
btnExit.Enabled = False ¡¥ disable exit button
Endif
End sub
I have a small application with two buttons and three textboxes
with databinding.
One of the textboxes has a ¡§textchanged¡¨ event and other 2 textboxes
are attached with the same events. If I type into any textboxes then
btnSave and btnExit will enable/disable respectively. The problem is
that in some instances ¡¥text changed event¡¨ hits endless loop and
causes an stackoverflow message. Is there a way to solve this
problem? I¡¦d appreciate any help. Thanks
Private sub Form1_Activated (..)
¡K
Text1.Databindings.Add(New Binding(¡§Text¡¨, ds.tables(0), ¡§City¡¨)
Text2.Databindings.Add(New Binding(¡§Text¡¨, ds.tables(0), ¡§State¡¨)
Text3.Databindings.Add(New Binding(¡§Text¡¨, ds.tables(0), ¡§Zip¡¨)
Addhander Text1.TexChnaged, AddressOf Form1_TextChanged
Addhander Text2.TexChnaged, AddressOf Form1_TextChanged
Addhander Text3.TexChnaged, AddressOf Form1_TextChanged
End sub
Private sub Form1_TextChanged(..) Handles textbox1_TextChanged
Me.bindingCntact(ds).EndCurrentEdit() „² causes endless lop
If ds.HasChanged = True then
btnSave.Enabled = True ¡¥ enable save button
btnExit.Enabled = False ¡¥ disable exit button
Endif
End sub