Leaderboard
Popular Content
Showing content with the highest reputation on 03/09/2017 in all areas
-
[New Version] - 16 Apr 2022 Added: A new function _GUIExtender_Hidden_Control which allows you to specify which controls should not be automatically reshown when it redraws the GUI. You no longer need to hide/show the control within the script - this function does that as well as telling the UDF whether or not to show it on redraw. New UDF and an additional example in the zip below. Previous changes: Changelog.txt ........................................................................... The GUIExtender UDF allows you to have multiple sections within your GUIs which can be either static or extendable. The extendable sections can be extended and retracted either by UDF created buttons or programmatically by other controls or HotKeys. The controls on the sections are fully functional and there is no overlap problem when retracted (see the details section if you want to know how). The UDF can be used in both MessageLoop and OnEvent modes and with both native and UDF created controls, as well as embedded objects and child GUIs. -------------------------------------------------------------- Note: This is a new recoded and (I hope) simplified version of my earlier UDF of the same name. If you move to this new version there are several script-breaking changes, so please look carefully at the included example scripts to see where things have changed. Here is a quick guide to how the UDF function list has been altered: Old function New function Comment _Init _Init Unchanged _Clear _Clear Unchanged _Section_Start _Section_Create New default parameters for position and size _Section_End Deprecated _Section_Create used to end all section creation _Section_Action _Section_Activate Simple rename _Action _EventMonitor Simple rename _Section_Extend _Section_Action Simple rename, but now uses integer parameter for required state _Section_State _Section_State Unchanged _Restore Deprecated Now automatic _ActionCheck Deprecated Now automatic _HandleCheck Deprecated Now automatic _Obj_Data _Obj_Data Unchanged - _Handle_Data Single call on creation replaces multiple _HandleCheck calls Note: The _EventMonitor function must be added to the idle loop for the automatic actions above to occur -------------------------------------------------------------- Details of how the UDF works for those who are interested: The UDF and plenty of commented examples are in the attached zip: GUIExtender.zip M231 point
-
1 point
-
siva1612, If I remove the _GUIScrollBars_ShowScrollBar line I get all the labels displayed - I tested up to 200. You can remove the horizontal scrollbar by setting the _GUIScrollbars_Generate horizontal parameter to 0: #include <GUIConstantsEx.au3> #include <GUIScrollbars_Ex.au3> #include <StaticConstants.au3> Opt("GUIOnEventMode", 1) $MainScreen = GUICreate("Expense Tracker", 600, 520, -1, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitAll") GUISetBkColor(0xE0E0E0) GUISetState() $CategoriesListScr = GUICreate("", 250, 480, 0, 40, $WS_POPUP, $WS_EX_MDICHILD, $MainScreen) GUISetFont(14, 500, 0, "Calibri") GUISetBkColor(0xFFFFFF) GUICtrlSetResizing($CategoriesListScr, $GUI_DOCKALL) GUISetState() $LastLine = -30 For $LabelCnt = 0 To 200; Working fine $LastLine += 40 GUICtrlCreateLabel("Test String" & $LabelCnt, 47, $LastLine, 250, 40, $SS_CENTERIMAGE) Next _GUIScrollbars_Generate($CategoriesListScr, 0, $LastLine + 40) ;_GUIScrollBars_ShowScrollBar($CategoriesListScr, $SB_HORZ, False) While 1 Sleep(10) ; You need a Sleep to stop the CPU from frying <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< WEnd Func ExitAll() Exit EndFunc ;==>ExitAll Note my comment about the idle loop Sleep. M231 point
-
Cascraft, Welcome to the AutoIt forums. This seems to work: #include <GUIConstantsEx.au3> #include <Misc.au3> #include <GuiComboBox.au3> Local $hDLL = DllOpen("user32.dll") $Form1 = GUICreate("Form1", 310, 152, 361, 178) $Combo1 = GUICtrlCreateCombo("Combo1", 16, 64, 145, 25) GUICtrlSetData(-1, "Item1|Item2|Item3|Item4|Item5") $Label1 = GUICtrlCreateLabel("Press Alt+F TO select UP", 16, 16, 128, 17) $Label2 = GUICtrlCreateLabel("Press Alt+C TO select DOWN", 16, 40, 143, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE DllClose($hDLL) Exit EndSwitch If _IsPressed(12, $hDLL) And _IsPressed(46, $hDLL) Then $iIndex = _GUICtrlComboBox_GetCurSel($Combo1) If $iIndex < _GUICtrlComboBox_GetCount($Combo1) - 1 Then $iIndex += 1 $iRet = _GUICtrlComboBox_SetCurSel($Combo1, $iIndex) EndIf While _IsPressed(12, $hDLL) And _IsPressed(46, $hDLL) Sleep(10) WEnd ElseIf _IsPressed(12, $hDLL) And _IsPressed(43, $hDLL) Then ; SWITCH DOWN EndIf WEnd I leave the DOWN part to you. M231 point