Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Get transfered to a specified line of a RichTextbo...
Author:
Alexander Triantafyllou
E-mail:
Click to e-mail author
Submitted:
4/8/2003
Version:
VB5
Compatibility:
VB5, VB6
Category:
String Manipulation
Views:
10391
Get transfered to a specified line of a RichTextbox.
Declarations:
'IN A MODULE Public Const EM_LINEINDEX = &HBB Public Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" _ (ByVal hWnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ ByVal lParam As Any) As Long
Code:
'Get transfered to a specified line of a richtextbox 'programmed by Alexander Triantafyllou (BSc I.T.) 'alextriantf@yahoo.gr 'feel free to use it wherever you like ' 'Greetings from Athens - Greece 'IN A FORM 'insert a richtextbox and call it editbox public sub go_to_line linen = InputBox("Enter Line number:") If IsNumeric(linen) = True Then linen = linen - 1 charindex = SendMessage(editbox.hWnd, EM_LINEINDEX, ByVal linen, ByVal CLng(0)) editbox.SetFocus If charindex <> -1 Then editbox.SelStart = charindex End If Else MsgBox "Please input a line number", vbCritical End If end sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement