forum

Home / DeveloperSection / Forums / Using event in WPF

Using event in WPF

Anonymous User195111-Jun-2013
Hi Expert,

I have created two textboxes in WPF named is txt1 and txt2

I have written following line of code on txt1 lostFocus event

If txt1.Text is nothing then 
    txt1.Focus
End If

on txt2 lostFocus event

If txt2.Text is nothing then
    txt2.Focus
End If

Now, If txt1 and txt2 are both empty and user presses TAB key in txt1 the problem occurs. Program goes in infinite loop. I mean cursor comes to txt1 and goes to txt2 infinite times.I know This is normal behavior according to my code.

So I want to have validating event to avoid the problems like above. But I cannot find one in WPF. So which event should I use?

Thanks in advance for any recommendations or solutions.

Updated on 12-Jun-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By