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
Post a Comment