public void GotoPosAndFocus(ScintillaNet.ScintillaControl sci, int position) { int pos = sci.MBSafePosition(position); int line = sci.LineFromPosition(pos); sci.EnsureVisible(line); sci.GotoPos(pos); }