winux38 Posted February 28, 2010 Share Posted February 28, 2010 Hello, I am looking for a solution allowing me to use windows scroll bar in a standalone mode anywhere in my window to control other widgets. Control bar have to be horizontal or vertical. thanks for your help winux38 Link to comment Share on other sites More sharing options...
picea892 Posted February 28, 2010 Share Posted February 28, 2010 How about something like this expandcollapse popup#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 More sharing options...
Moderators Melba23 Posted February 28, 2010 Moderators Share Posted February 28, 2010 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. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
winux38 Posted March 2, 2010 Author Share Posted March 2, 2010 THanks a lot to both of you. I have not time to test it now but will come back to you as sonn as I'll have check your solution. winux38 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