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:
Private Sub Form_Load() Counter = 1 List1.AddItem Counter End Sub ' Note "Counter" IS declared in the declarations ! Private Sub RTB1_Change() Dim LineCount As Long LineCount = SendMessage(RTB1.hwnd, EM_GETLINECOUNT, ByVal 0&, ByVal 0&) ' Add line If LineCount > PrevCount Then Counter = Counter + 1 List1.AddItem Counter End If ' Delete Line If LineCount < PrevCount Then Counter = Counter - 1 List1.RemoveItem Counter End If 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 !




.
Reply With Quote