CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    Nov 2005
    Posts
    95

    kill off top line in an RTB

    Hello:

    I need to sroll an rtb upward (not talking about scroll bars) when the number of llines gets above a variable limit. I'm not really wanting to resize the RTB either...just want to delete the top line of the RTB (mayt have 1000 lines or so of text).

    Code:
      nRet = SendMessage(rtbCmdLog.hwnd, EM_GETLINECOUNT, 0&, ByVal 0&)
      Do While nRet > intLineLimit
       rtbCmdLog = Mid(rtbCmdLog, InStr(rtbCmdLog, vbCrLf) + 1) 'delete 1st line?
       nRet = SendMessage(rtbCmdLog.hwnd, EM_GETLINECOUNT, 0&, ByVal 0&) 'get new line count (reduced lines)
       rtbCmdLog.Refresh
    Loop   'continue deleting lines at top
    I've tried a few variations of this (vbCR, vs vbCrLf, etc), but all I get is a blanked out box (its erasing ALL of the text)...this way is also probably slow since it deals with a potentially huge string.
    Last edited by vbcandies; January 11th, 2010 at 12:52 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured