public static void ShowErrorPosition(Exception t, TextBox textBox, Db2SourceContext dataSet, int offset) { Tuple <int, int> ret = dataSet.GetErrorPosition(t, textBox.Text, offset); if (ret == null) { return; } textBox.Select(ret.Item1, ret.Item2); int l = textBox.GetLineIndexFromCharacterIndex(ret.Item1); textBox.ScrollToLine(l); textBox.Focus(); }