BryanWall Posted February 12, 2024 Posted February 12, 2024 How to add a horizontal scroll the listbox? I have tried $WS_HSCROLL, and I have tried using _GUICtrlListView_SetColumnWidth to set the listbox column width to be larger than the listbox itself as one post suggested. None of it is working. expand popup #Include <SQLite.au3> #include <GuiListBox.au3> #include <GuiListView.au3> #include <Date.au3> #include <File.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ScrollBarConstants.au3> #Include <Math.au3> #Include <Inet.au3> #Region CreateGUI ;create gui Global $hGUI = GUICreate("Applanix Automation", 400, 350, 210, 0) GUISetOnEvent($GUI_EVENT_CLOSE, EndCode) Global $btnBrowse = GUICtrlCreateButton("Start", 10, 2, 76, 20) Global $lblBrowse = GUICtrlCreateLabel("Project Directory", 100, 5, 286, 16) Global $Label_5 = GUICtrlCreateLabel("APPLANIX", 10, 30, 76, 20) Global $Label_1 = GUICtrlCreateLabel("TIME SYNC", 10, 55, 76, 20) Global $Label_2 = GUICtrlCreateLabel("INJ TC", 10, 80, 76, 20) Global $Label_3 = GUICtrlCreateLabel("INJ PP", 10, 105, 76, 20) Global $Label_4 = GUICtrlCreateLabel("DR", 10, 130, 76, 20) Global $lblApplxStatus = GUICtrlCreateLabel("n/x", 100, 30, 56, 20) Global $lblTSStatus = GUICtrlCreateLabel("n/x", 100, 55, 56, 20) Global $lblITCStatus = GUICtrlCreateLabel("n/x", 100, 80, 56, 20) Global $lblIPPStatus = GUICtrlCreateLabel("n/x", 100, 105, 56, 20) Global $lblDRStatus = GUICtrlCreateLabel("n/x", 100, 130, 56, 20) Global $lstLog = GUICtrlCreateList(" ", 30, 155, 346, 176, $listBoxStyle) GUISetState(@SW_SHOWNORMAL) for $i = 0 to 50 GUICtrlSetData($lstLog,_NowTime(5) & " " & 50 - $i & " testttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt") Next _GUICtrlListView_SetColumnWidth($lstLog,0,500) #EndRegion ;CreateGUI While 1 wend
Solution Andreik Posted February 12, 2024 Solution Posted February 12, 2024 (edited) expandcollapse popup#Include <SQLite.au3> #include <GuiListBox.au3> #include <GuiListView.au3> #include <Date.au3> #include <File.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ScrollBarConstants.au3> #Include <Math.au3> #Include <Inet.au3> #Region CreateGUI ;create gui Global $hGUI = GUICreate("Applanix Automation", 400, 350, 210, 0) ;~ GUISetOnEvent($GUI_EVENT_CLOSE, EndCode) Global $btnBrowse = GUICtrlCreateButton("Start", 10, 2, 76, 20) Global $lblBrowse = GUICtrlCreateLabel("Project Directory", 100, 5, 286, 16) Global $Label_5 = GUICtrlCreateLabel("APPLANIX", 10, 30, 76, 20) Global $Label_1 = GUICtrlCreateLabel("TIME SYNC", 10, 55, 76, 20) Global $Label_2 = GUICtrlCreateLabel("INJ TC", 10, 80, 76, 20) Global $Label_3 = GUICtrlCreateLabel("INJ PP", 10, 105, 76, 20) Global $Label_4 = GUICtrlCreateLabel("DR", 10, 130, 76, 20) Global $lblApplxStatus = GUICtrlCreateLabel("n/x", 100, 30, 56, 20) Global $lblTSStatus = GUICtrlCreateLabel("n/x", 100, 55, 56, 20) Global $lblITCStatus = GUICtrlCreateLabel("n/x", 100, 80, 56, 20) Global $lblIPPStatus = GUICtrlCreateLabel("n/x", 100, 105, 56, 20) Global $lblDRStatus = GUICtrlCreateLabel("n/x", 100, 130, 56, 20) Global $lstLog = GUICtrlCreateList(" ", 30, 155, 346, 176, BitOR($WS_HSCROLL, $WS_VSCROLL)) ; <<<--- You need WS_HSCROLL style GUICtrlSetLimit($lstLog, 1000) ; <<<--- set the limit of horizontal scrolling GUISetState(@SW_SHOWNORMAL) for $i = 0 to 50 GUICtrlSetData($lstLog,_NowTime(5) & " " & 50 - $i & " testttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt") Next ;~ _GUICtrlListView_SetColumnWidth($lstLog,0,500) #EndRegion ;CreateGUI Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Edited February 12, 2024 by Andreik
BryanWall Posted February 12, 2024 Author Posted February 12, 2024 (edited) Thank you. So it was something simple and I must have just missed it when looking at other similar topics. Edited February 12, 2024 by BryanWall
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