LB Booster
« SetScrollPos »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:43am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: SetScrollPos  (Read 236 times)
SarmedNafi
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 93
xx SetScrollPos
« Thread started on: Aug 8th, 2015, 2:16pm »

Dear Sir,

I need to use SetScrollPos function and let it work like GetScrollPos, I got error, can you help, please.

calldll #user32, "GetScrollPos", hscrolV as ulong, _SB_VERT as long, posv as long

https://msdn.microsoft.com/en-us/library/windows/desktop/bb787597(v=vs.85).aspx

Regards
User IP Logged

SarmedNafi
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 93
xx Re: SetScrollPos
« Reply #1 on: Aug 8th, 2015, 3:02pm »

Dear Sir,

I found a way to do that, don't disturb your self.

Thank you for being on the other side listen to us.

The following is the demo:
NOMAINWIN
WindowWidth = 559 : WindowHeight = 446
UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
UpperLeftY = INT((DisplayHeight-WindowHeight)/2)

graphicbox #main.graphicbox1, 355, 25, 50, 285
stylebits #main.button1, _BS_MULTILINE, 0, 0, 0
button #main.button1, "Get", [button1Click], UL, 35, 125, 85, 30
stylebits #main.button2, _BS_MULTILINE, 0, 0, 0
button #main.button2, "Set", [button2Click], UL, 35, 195, 85, 30
textbox #main.textbox1, 30, 25, 190, 25



Open "Window Title" for Window as #main


#main "trapclose [quit]"
#main.graphicbox1 "setfocus; when mouseMove MouseChange"
#main "font ms_sans_serif 10"
#main.graphicbox1 "VERTSCROLLBAR on 0 "; 100
hscrolV=hwnd(#main.graphicbox1)
Wait

[quit]
close #main : END

Sub MouseChange handle$, X, Y
'X and Y contain mouse coordinates
'#handle$ contains graphicbox handle
End Sub

[button1Click]
calldll #user32, "GetScrollPos", hscrolV as ulong, _SB_VERT as long, posv as long
#main.textbox1 posv

wait

[button2Click]
#main.textbox1 "!contents? posv"
calldll #user32, "SetScrollPos", hscrolV as ulong, _SB_VERT as long, posv as long, redraw as Boolean
#main.graphicbox1 "refresh"

'#handle$ contains button handle
wait

Regards
Sarmed
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls