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

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -