DannyJ Posted July 22, 2019 Share Posted July 22, 2019 Hello Auto It Forum, I load an Excel file to a dropdown menu, and it takes several seconds. I want to disable this menu until the Excel is not loaded. While the Dropdown writes that Loading I want to disable the drotown Here is my example, which is unfortunately it works inversely: So it DISables the button after it loaded, I need that before expandcollapse popup#include <Array.au3> #include <SendMessage.au3> #include <GUIConstantsEx.au3> #include <ComboConstants.au3> #include <WindowsConstants.au3> #include <_XLSXReadToArray.au3> #include <Excel.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437) $hCombo = GUICtrlCreateCombo("Loading", 120, 192, 400, 30, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE, $CBS_DISABLENOSCROLL)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $aXLSX, $iError, $iExtended, $sXLSX $aXLSX = _XLSXReadToArray(@ScriptDir & "\abc.xlsx", 0, 0, 0) ConsoleWrite("Fonoöts " & $aXLSX & @CRLF) ;_Excel_SheetActivate($aXLSX, "DATA") ;$list = _Excel_SheetList($aXLSX) ;ConsoleWrite($list) $iError = @error $iExtended = @extended ConsoleWrite("$iError = " & $iError & " - $iExtended = " & $iExtended & @LF) ;_ArrayDisplay($aXLSX) For $i = 2 To $aXLSX[0][0] $sXLSX &= $aXLSX[$i][0] & "|" ;ConsoleWrite("$sXLSX: " & $sXLSX & @CRLF) Next _SendMessage(GUICtrlGetHandle($hCombo), $CB_RESETCONTENT) GUICtrlSetData($hCombo, $sXLSX, "") _SendMessage(GUICtrlGetHandle($hCombo), $CB_RESETCONTENT) GUICtrlSetState($hCombo, $GUI_Disable) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $hCombo $sXLSX = GUICtrlRead($hCombo) For $i = 2 To $aXLSX[0][0] If $sXLSX = $aXLSX[$i][0] Then MsgBox(0, $i, $aXLSX[$i][1]) ;;do something ;;$aXLSX[$i][1] ;;$aXLSX[$i][2] ;;$aXLSX[$i][3] ExitLoop EndIf Next EndSwitch WEnd Thank you in advance your help Link to comment Share on other sites More sharing options...
mikell Posted July 22, 2019 Share Posted July 22, 2019 (edited) Suggestion (untested) GUICtrlSetState($hCombo, $GUI_Disable) For $i = 2 To $aXLSX[0][0] $sXLSX &= $aXLSX[$i][0] & "|" ;ConsoleWrite("$sXLSX: " & $sXLSX & @CRLF) Next GUICtrlSetData($hCombo, "|" & $sXLSX, "") GUICtrlSetState($hCombo, $GUI_Enable) Edit If the above fails you might try _GUICtrlComboBox_BeginUpdate Edited July 22, 2019 by mikell DannyJ and Skysnake 1 1 Link to comment Share on other sites More sharing options...
DannyJ Posted July 22, 2019 Author Share Posted July 22, 2019 (edited) Thank you very much Yeah I forgot ENABLE the button XD Edited July 22, 2019 by DannyJ 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