1

我需要从行号 Y 开始的 textctrl 中间删除 X 行

有什么简单的方法可以做到这一点?我看不到:似乎我必须以某种方式搜索 TextCtrl 计数换行符的内容才能找到 Y 的位置...

4

1 回答 1

1
    if self._log.GetNumberOfLines() > MAX_LINES:
        if self._log.GetLineText(DELETION_POINT) != DELETION_LINE:
            start = self._log.XYToPosition(0, DELETION_POINT)
            self._log.SetInsertionPoint(start)
            self._log.WriteText(DELETION_LINE)
        while (self._log.GetNumberOfLines() > MAX_LINES):
            start = self._log.XYToPosition(0, DELETION_POINT+1)
            len = self._log.GetLineLength(DELETION_POINT+1)
            self._log.Remove(start, start+len+1)
于 2011-08-27T12:57:06.600 回答