Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools


Click here to copy the following block
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
  hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
  lParam As Any) As Long
Const EM_LINEFROMCHAR = &HC9
Const EM_LINEINDEX = &HBB

' Get the line/column coordinates of a given character (both are zero-based).
' If charIndex is negative, it returns the coordinates of the caret

Sub TextBoxGetLineColumn(tb As TextBox, ByVal charIndex As Long, line As Long, _
  column As Long)
  If charIndex < 0 Then charIndex = tb.SelStart
  ' Get the line number.
  line = SendMessage(tb.hwnd, EM_LINEFROMCHAR, charIndex, ByVal 0&)
  ' Get the column number by subtracting the line's start
  ' index from the caret position
  column = tb.SelStart - SendMessage(tb.hwnd, EM_LINEINDEX, line, ByVal 0&)
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.