Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Richtextbox - first visible line/position of 1st char on the line


Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
( ByVal hWnd As Long , ByVal wMsg As Long , ByVal wParam As Long , lParam As Any) As Long

Public Const EM_LINEINDEX = &HBB
Public Const EM_GETFIRSTVISIBLELINE = &HCE

iTopLine = SendMessage(RichTextBox1.hwnd, EM_GETFIRSTVISIBLELINE, 0, 0))
iPositionofFirstCharOfTopLine = SendMessage(RichTextBox1.hWnd, EM_LINEINDEX, iTopLine, 0&)