Aaron3569 Posted May 20, 2021 Share Posted May 20, 2021 Hello, it seems like the smallest value you can scroll is 1 , but if you scroll really slowly it looks jittery (you can see clearly each step). Is there a way to achive smoother scrolling? i am trying to make the GUI scrollable with the mouse (holding right mouse button down and moving the mouse to scroll) thanks in advance 🖐️ Link to comment Share on other sites More sharing options...
pixelsearch Posted May 20, 2021 Share Posted May 20, 2021 (edited) 13 hours ago, Aaron3569 said: Is there a way to achive smoother scrolling? Based on your script in another post, here is a smooth scroll of 1 pixel (adjustable in variable $iPixels) in 4 directions, using 4 direction keys. No scrollbars. It may help you to achieve your goal : expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{RIGHT}", "ScrollRight") HotKeySet("{LEFT}", "ScrollLeft") HotKeySet("{UP}", "ScrollUp") HotKeySet("{DOWN}", "ScrollDown") Global $iPixels = 1 $hParent = GUICreate("Parent", 1000, 700) GUICtrlCreateButton("Button", 50, 50, 50, 50) GUISetState() $hChild = GUICreate("Child", 200, 200, -1,-1, $WS_CHILD , -1, $hParent) GUISetBkColor(0x000000) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func ScrollRight() _ScrollWindow($hParent, $iPixels, 0) EndFunc Func ScrollLeft() _ScrollWindow($hParent, - $iPixels, 0) EndFunc Func ScrollUp() _ScrollWindow($hParent, 0, - $iPixels) EndFunc Func ScrollDown() _ScrollWindow($hParent, 0, $iPixels) EndFunc Func _ScrollWindow($hWnd, $iXAmount, $iYAmount) Return DllCall("user32.dll", "bool", "ScrollWindow", "hwnd", $hWnd, "int", $iXAmount, "int", $iYAmount, "ptr", 0, "ptr", 0)[0] EndFunc ;==>_ScrollWindow Edited May 20, 2021 by pixelsearch Aaron3569 1 Link to comment Share on other sites More sharing options...
Aaron3569 Posted May 21, 2021 Author Share Posted May 21, 2021 8 hours ago, pixelsearch said: Based on your script in another post, here is a smooth scroll of 1 pixel (adjustable in variable $iPixels) in 4 directions, using 4 direction keys. No scrollbars. It may help you to achieve your goal : expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{RIGHT}", "ScrollRight") HotKeySet("{LEFT}", "ScrollLeft") HotKeySet("{UP}", "ScrollUp") HotKeySet("{DOWN}", "ScrollDown") Global $iPixels = 1 $hParent = GUICreate("Parent", 1000, 700) GUICtrlCreateButton("Button", 50, 50, 50, 50) GUISetState() $hChild = GUICreate("Child", 200, 200, -1,-1, $WS_CHILD , -1, $hParent) GUISetBkColor(0x000000) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func ScrollRight() _ScrollWindow($hParent, $iPixels, 0) EndFunc Func ScrollLeft() _ScrollWindow($hParent, - $iPixels, 0) EndFunc Func ScrollUp() _ScrollWindow($hParent, 0, - $iPixels) EndFunc Func ScrollDown() _ScrollWindow($hParent, 0, $iPixels) EndFunc Func _ScrollWindow($hWnd, $iXAmount, $iYAmount) Return DllCall("user32.dll", "bool", "ScrollWindow", "hwnd", $hWnd, "int", $iXAmount, "int", $iYAmount, "ptr", 0, "ptr", 0)[0] EndFunc ;==>_ScrollWindow thats awesome, thanks aigan ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now