Click here to Skip to main content
15,893,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In My Project First Time Page Loaded, All Controls Are Disable.
When We Clicking The New Button , Controls Are Enabled, Set Focus on TextBox.
But Cursor Focusing Is Ok, When Typing on The KeyBoard it Not Display on It.



After Clicking The TextBox With Mouse Or Pressing Escape Button is Works Correctly.



How To Solve it Without Mouse Click or Escape Button,
Posted

1 solution

C#
private void Button_Click(object sender, RoutedEventArgs e)
      {
          txt1.IsEnabled = true;
          txt2.IsEnabled = true;
          txt3.IsEnabled = true;
          txt1.Focus();
      }

      private void Window_Loaded(object sender, RoutedEventArgs e)
      {
          txt1.IsEnabled = false;
          txt2.IsEnabled = false;
          txt3.IsEnabled = false;
      }


here txt1 will be get focused and keyboard work fine without clicking txt1
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900