Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to set focus in textbox inside wpf user control?

$
0
0

Hi all,

I am using two textbox control and two checkbox control named as  textbox1 , textbox2,checkbox1 and checkbox2. Actually what i want to give functionality in my code, when i checked Checkbox1 then my texbox1 should get focus.and same for another  checkbox2. i am using below code for  checkebox on checked event :

                    DispatcherPriority.ContextIdle,

                  new Action(delegate()
                  {

                      textbox1 .Focus();

                  }));

if i checked individually then it works fine but after got focus on textbox1. if i checked checkbox2 my textbox2 is not going to focus(viceversa).

Please help me 

Thanks


sumitk



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>