[bb] TextAreaJumpToLine by Red [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:39

Previous topic - Next topic

BlitzBot

Title : TextAreaJumpToLine
Author : Red
Posted : 1+ years ago

Description : B+ v1.34

Userlibs : userlibs/user32.decls
.lib "user32.dll"
SendMessage%(hwnd, msg, wParam, mParam):"SendMessageA"

Example
numline=Rand(0,TextAreaLen(txt,2)-1)
TextAreaJumpToLine txt,numline


functions : [/i]

Code :
Code (blitzbasic) Select
[code]
Function TextAreaJumpToLine(txt,numline)
Local EM_LINESCROLL=$B6
Local curY=TextAreaCursor( txt,2 )
Local scrollY=numline-curY
sendmessage(QueryObject(txt,1), EM_LINESCROLL,  0, scrollY)
End Function
[/code]

Comments : none...