In C #, is it possible to get the bool value by determining if the cursor is in a specific text field?
What I want to achieve:
I have a main page with two buttons; search button and login button. Depending on which text block is active or has focus, or if there is no focus, I want to set the UseSubmitBehavior attribute.
What I want is something like this (I know this code is not working):
if (textboxUsername.hasfocus == true || textboxPassword.hasfocus == true)
{
buttonLogin.UseSubmitBehavior = true;
buttonSearch.UseSubmitBehavior = false;
}
else
{
buttonLogin.UseSubmitBehavior = false;
buttonSearch.UseSubmitBehavior = true;
}
The goal is to make the page react as the user expects it, for example. itβs actually a search when you get to the input, and not an attempt to enter the system when you enter text in the search field.