I am making an HTML editor, and i'm in the progress of making a counter in the left side of that screen, that shows wich line youre on, like i other editors as editplus... I use sendmessage, but i cant get it too work probably, here's the code i'm using:
VB Code:
  1. Private Sub Form_Load()
  2. Counter = 1
  3. List1.AddItem Counter
  4. End Sub
  5. ' Note "Counter" IS declared in the declarations !
  6. Private Sub RTB1_Change()
  7. Dim LineCount As Long
  8. LineCount = SendMessage(RTB1.hwnd, EM_GETLINECOUNT, ByVal 0&, ByVal 0&)
  9. ' Add line
  10. If LineCount > PrevCount Then
  11. Counter = Counter + 1
  12. List1.AddItem Counter
  13. End If
  14. ' Delete Line
  15. If LineCount < PrevCount Then
  16. Counter = Counter - 1
  17. List1.RemoveItem Counter
  18. End If
  19. End Sub

My problem is that if the user deletes more than one line, the listbox only get's one number removed .
This is driving me nuts !

Please help !!!

Thanks in advance !