You need to get to the PART_EditableTextBox control from the list control template. The easiest way to do this is to override OnApplyTemplate when displaying ComboBox , and then use this output wherever you need a combo box with this advanced behavior.
protected void override OnApplyTemplate() { var myTextBox = GetTemplateChild("PART_EditableTextBox") as TextBox; if (myTextBox != null) { this.editableTextBox = myTextBox; } }
After you have the text box, you can set the position of the carriage, set the SelectionStart to the location where you want the carriage to be displayed and set SelectionLength to zero.
public void SetCaret(int position) { this.editableTextBox.SelectionStart = position; this.editableTextBox.SelectionLength = 0; }
Jeff yates
source share