Results 1 to 1 of 1

Thread: Over flow Error

  1. #1

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Over flow Error

    Dear All,
    I am using this code to get the Line Number from a given position in a Richtextbox.
    VB Code:
    1. Option Explicit
    2. Public Declare Function SendMessage Lib _
    3.     "user32" Alias "SendMessageA" _
    4.     (ByVal hwnd As Long, _
    5.      ByVal wMsg As Long, _
    6.      ByVal wParam As Long, _
    7.      lParam As Any) As Long
    8. Public Const EM_LINEFROMCHAR = &HC9
    9. Public Function TextBoxLineNumberFromCursor(TBox As RichTextBox, pos As Long) As Long
    10.  
    11.   TextBoxLineNumberFromCursor = SendMessage(TBox.hwnd, EM_LINEFROMCHAR, pos, 0&)
    12. End Function
    13.  
    14. 'and  I call this Function as
    15. Dim x as long
    16. 'rtb is richtextbox
    17. x=TextBoxLineNumberFromCursor(rtb,32271)
    18.  
    19. 'and I am getting an oveflow error for this
    20. 'I dont know why
    Last edited by danasegarane; Jan 20th, 2007 at 07:37 AM.
    Please mark you thread resolved using the Thread Tools as shown

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