Ejemplo n.º 1
0
		public void GotoPosAndFocus(ScintillaNet.ScintillaControl sci, int position)
		{
			sci.MBSafeGotoPos(position);
			int line = sci.LineFromPosition(sci.CurrentPos);
			// TODO  The folding makes the line centering fail - solution: expand all folds / make it smarter.
			//sci.EnsureVisible(line);
			sci.ExpandAllFolds();
			int top = sci.FirstVisibleLine;
			int middle = top + sci.LinesOnScreen/2;
			sci.LineScroll(0, line-middle);
			//
			((Control)sci).Focus();
		}