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.Databindi ngs.Add(New Binding(¡§Text¡ ¨, ds.tables(0), ¡§City¡¨)
Text2.Databindi ngs.Add(New Binding(¡§Text¡ ¨, ds.tables(0), ¡§State¡¨)
Text3.Databindi ngs.Add(New Binding(¡§Text¡ ¨, ds.tables(0), ¡§Zip¡¨)
Addhander Text1.TexChnage d, AddressOf Form1_TextChang ed
Addhander Text2.TexChnage d, AddressOf Form1_TextChang ed
Addhander Text3.TexChnage d, AddressOf Form1_TextChang ed
End sub
Private sub Form1_TextChang ed(..) Handles textbox1_TextCh anged
Me.bindingCntac t(ds).EndCurren tEdit() „² 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.Databindi ngs.Add(New Binding(¡§Text¡ ¨, ds.tables(0), ¡§City¡¨)
Text2.Databindi ngs.Add(New Binding(¡§Text¡ ¨, ds.tables(0), ¡§State¡¨)
Text3.Databindi ngs.Add(New Binding(¡§Text¡ ¨, ds.tables(0), ¡§Zip¡¨)
Addhander Text1.TexChnage d, AddressOf Form1_TextChang ed
Addhander Text2.TexChnage d, AddressOf Form1_TextChang ed
Addhander Text3.TexChnage d, AddressOf Form1_TextChang ed
End sub
Private sub Form1_TextChang ed(..) Handles textbox1_TextCh anged
Me.bindingCntac t(ds).EndCurren tEdit() „² causes endless lop
If ds.HasChanged = True then
btnSave.Enabled = True ¡¥ enable save button
btnExit.Enabled = False ¡¥ disable exit button
Endif
End sub
Comment