wpf - Editable ComboBox setting caret position using mvvm -


i have editable wpf combobox. want set caret position end of text whenever gets focus.

you can on gotfocus event:

textbox textbox = this.combo.childrenoftype <textbox>().                        firstordefault(element => element.name == "part_editabletextbox");  // if textbox null return if (textbox == null) {     return; } // if textbox == null  // set caret index of textbox textbox.caretindex = textbox.text.length; 

part_editabletextbox name of textbox provides editing in editable combobox.


Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -