Jump to content

Standalone scroll bar


winux38
 Share

Recommended Posts

How about something like this

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>

$iLastPos = IniRead("Test.ini", "Scroll", "VPos", 0)

$GUI = GUICreate("Test Script", 600, 200)

$ListView = GUICtrlCreateListView("Col          ", 20, 20, 40, 160)
$hListView = GUICtrlGetHandle($ListView)
_ControlToRoundedRectangle($ListView,21,0,40, 160,0)
$ListView2 = GUICtrlCreateListView("Col          ", 280, 20, 260, 160)
_ControlToRoundedRectangle($ListView2,0,0,240, 160,0)
$hListView2 = GUICtrlGetHandle($ListView2)

For $i = 1 To 80
    GUICtrlCreateListViewItem("Item " & $i, $ListView)
    GUICtrlCreateListViewItem("Next " & $i, $ListView2)
Next

GUISetState(@SW_SHOW, $GUI)

While 1
    Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    if _GUICtrlListView_GetTopIndex($hListView)<_GUICtrlListView_GetTopIndex($hListView2) then 
            _GUICtrlListView_Scroll($hListView2, 0, -12)
    elseif _GUICtrlListView_GetTopIndex($hListView)>_GUICtrlListView_GetTopIndex($hListView2) then 
            _GUICtrlListView_Scroll($hListView2, 0, +12)
    EndIf
    
WEnd

Func _ControlToRoundedRectangle($aControl,$X1,$Y1,$X2,$Y2,$X3)
    Local $l
    Local $handle = GUICtrlGetHandle($aControl)
    $l = DllCall("gdi32.dll","int","CreateRoundRectRgn","int",$X1,"int",$Y1,"int",$X2,"int",$Y2,"int",$X3,"int",$X3)
    DllCall("user32.dll","int","SetWindowRgn","hwnd",$handle,"int",$l[0],"int",True)
EndFunc
Link to comment
Share on other sites

  • Moderators

winux38.

Take a look at this thread where I developed a stand-alone scrollbar for another member. I hope it might work for you too. :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...