コード例 #1
0
        public static void GetLineAndPosFromIndex(this TextBoxBase self, int index, out int line, out int pos)
        {
            line = self.GetLineFromCharIndex(index);
            int linepos = self.GetFirstCharIndexFromLine(line);

            pos = index - linepos;
        }
コード例 #2
0
 private static void DelLine(TextBoxBase rtb, int index) =>
 rtb.Text = rtb.Text.Remove(rtb.GetFirstCharIndexFromLine(index) - 1, rtb.Lines[index].Length + 1);