Answered by:
how to deactivate a specific control while page loading

Question
-
Peace upon you
i have a "SearchBox" control, i have implemented "SuggestionsRequested" event.
when i open the application, the searchbox is the first control to be activated and it shows suggestions.
like this:
all what i need is to make this searchbox and suggestions deactivated until users put the pointer of the mouse inside the "searchbox"
thanks in advance :)Thursday, December 19, 2013 9:10 PM
Answers
-
You should set the initial focus to a different control.
You don't want to actually disable the control. That will prevent the user from tabbing to it later.
--Rob
- Marked as answer by Rob Caplan [MSFT]Microsoft employee, Moderator Friday, December 20, 2013 11:08 PM
Thursday, December 19, 2013 11:33 PMModerator -
Thanks Rob , i made it
i put this block of code into the constructor of the page
base.Loaded += (s, e) => { TextBox.SelectAll(); TextBox.Focus(FocusState.Programmatic); };
TextBox: refers to another control
so my searchBox will not be on Focus state
- Edited by BeginnerDev Friday, December 20, 2013 1:08 PM
- Marked as answer by Rob Caplan [MSFT]Microsoft employee, Moderator Friday, December 20, 2013 11:08 PM
Friday, December 20, 2013 12:03 PM
All replies
-
You should set the initial focus to a different control.
You don't want to actually disable the control. That will prevent the user from tabbing to it later.
--Rob
- Marked as answer by Rob Caplan [MSFT]Microsoft employee, Moderator Friday, December 20, 2013 11:08 PM
Thursday, December 19, 2013 11:33 PMModerator -
Thanks Rob , i made it
i put this block of code into the constructor of the page
base.Loaded += (s, e) => { TextBox.SelectAll(); TextBox.Focus(FocusState.Programmatic); };
TextBox: refers to another control
so my searchBox will not be on Focus state
- Edited by BeginnerDev Friday, December 20, 2013 1:08 PM
- Marked as answer by Rob Caplan [MSFT]Microsoft employee, Moderator Friday, December 20, 2013 11:08 PM
Friday, December 20, 2013 12:03 PM