March 01, 2021, 10:35:39 PM

Author Topic: [bb] TextAreaJumpToLine by Red [ 1+ years ago ]  (Read 430 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] TextAreaJumpToLine by Red [ 1+ years ago ]
« on: June 29, 2017, 12:28:39 AM »
Title : TextAreaJumpToLine
Author : Red
Posted : 1+ years ago

Description : B+ v1.34

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

Example
Code: [Select]
numline=Rand(0,TextAreaLen(txt,2)-1)
TextAreaJumpToLine txt,numline


functions : [/i]

Code :
Code: BlitzBasic
  1. [code]
  2. Function TextAreaJumpToLine(txt,numline)       
  3.         Local EM_LINESCROLL=$B6
  4.         Local curY=TextAreaCursor( txt,2 )
  5.         Local scrollY=numline-curY
  6.         sendmessage(QueryObject(txt,1), EM_LINESCROLL,  0, scrollY)
  7. End Function
[/code]

Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal