How to avoid autoselect when textbox has focus in windows phone sdk 7.1? -
let's have textbox number 123.456 (inputscope="number")
when gets focus, after tapped it, 456 autoselected.
i can't see property cancel this. there hidden way ?
you deselect whenever selection made handling selectionchanged
event. example
private void mytextbox_selectionchanged(object sender, routedeventargs e) { //get position user clicked int start = mytextbox.selectionstart; //detach event handler it's not fired when clear selection mytextbox.selectionchanged -= mytextbox_selectionchanged; //clear selection keep cursor in place would've been mytextbox.select(start, 0); //reattach handler mytextbox.selectionchanged += mytextbox_selectionchanged; }
this should prevent text being selected. actual position user tapped within textbox, can handle tap
event , use getposition()
method of gestureeventargs
parameter passed.
Comments
Post a Comment