Sign in to follow this  
Followers 0
Odewallrus

Tab not being painted gui loads

4 posts in this topic

#1 ·  Posted (edited)

I have looked and read for 2 days now without finding what I assume is a simple solution. Can someone please look at the codebelow and help me to understand why when the gui opens the controls on the default tab (tab1) do not show up unless another tab is selected and tab1 is re-selected. I am trying to get the controls to be available when the form opens.

This code uses GUIScrollbars_Ex.au3 which I have attached if needed. and reads a MobileMan.ini file the contents wich are below.

Thank you,

[Groups]
ActiveGroups=MobileTest,Mobile

[Mobile]
ActiveHosts=computer1,computer2,computer3,computer4

[MobileTest]
ActiveHosts=computer5,computer6

#include <GuiConstants.au3>
#include <GuiEdit.au3>
#Include <Date.au3>
#include <GUIScrollbars_Ex.au3>
#include <Array.au3>
$Logfile = @ScriptDir & '\' & @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "-" & @min & "-" & @SEC & "_" & 'MobileMan.log'
Global $aHosts[1][18] = [[0, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",""]]
;~ Create Gui
$sTitle = "Mobile Management Console"
$sINI = @ScriptDir & "\MobileMan.ini"
$GUI = GUICreate($sTitle,900, 570, -1, -1)
$MessageMenu = GUICtrlCreateMenu("&File")
$HelpMenu = GUICtrlCreateMenu("Help")
GUICtrlCreateTab(160,10,730,310)
$tabFreeform = GUICtrlCreateTabItem("tab1")
$tabInpMessage = GUICtrlCreateInput("Enter text here...", 180,50,400,40, $ES_MULTILINE )
GUICtrlCreateTabItem("tab2")
GUICtrlCreateTabItem("tab3")
GUICtrlCreateTabItem("tab4")
GUISetState()
;~ Create Child gui
$cGUI = GUICreate("Child GUI", 140,525,10,10, $WS_CHILD, $WS_EX_CLIENTEDGE, $Gui)
GUICtrlSetResizing($cGUI, $GUI_DOCKALL)
Opt("GUICoordMode", 2)
$GrpCord = GUISetCoord(5,5)
$bToggleAll = GUICtrlCreateButton("Toggle All", -1, 1, 115, 20)
GUISetState()
FileOpen($Logfile,1)
FileWrite($Logfile, _Now() & " - Session started" & @CRLF)
;~ Read ini
$aGroups = IniReadSection($sINI, "Groups")
If @error Then
MsgBox(16, "Error", "Failed to read 'Groups' section.")
FileWrite($Logfile, _Now() & " - Failed to read 'Groups' section" & @CRLF)
Exit
EndIf
If ($aGroups[0][0] >= 1) And ($aGroups[1][0] = "ActiveGroups") Then
$aActiveGroups = StringSplit($aGroups[1][1], ",")
If ($aActiveGroups[0] = 1) And (StringStripWS($aActiveGroups[1], 8) = "") Then Dim $aActiveGroups[1] = [0]
Else
MsgBox(16, "Error", "Missing or invalid Groups keys.")
FileWrite($Logfile, _Now() & " - Missing or invalid Groups keys" & @CRLF)
Exit
EndIf
For $g = 1 To $aActiveGroups[0]
$sGroupName = $aActiveGroups[$g]
$aGroupSection = IniReadSection($sINI, $sGroupName)
If @error Then
     MsgBox(16, "Error", "Failed to read groups section: '" & $sGroupName & "'.")
FileWrite($Logfile, _Now() & " - Failed to read groups section: '" & $sGroupName & "'" & @CRLF)
     ContinueLoop
EndIf
If ($aGroupSection[0][0] >= 1) And ($aGroupSection[1][0] = "ActiveHosts") Then
     $aActiveHosts = StringSplit($aGroupSection[1][1], ",")
     If ($aActiveHosts[0] = 1) And (StringStripWS($aActiveHosts[1], 8) = "") Then Dim $aActiveHosts[1] = [0]
     For $h = 1 To $aActiveHosts[0]
         _AddActiveHost($sGroupName, $aActiveHosts[$h])
     Next
Else
     MsgBox(16, "Error", "Missing or invalid keys in group: '" & $sGroupName & "'.")
FileWrite($Logfile, _Now() & " - Missing or invalid keys in group: '" & $sGroupName & "'." & @CRLF)
     ContinueLoop
EndIf
Next
Dim $GrpButton[($aActiveGroups[0] + 1)]
$Btn_Start = GUICtrlCreateDummy()
For $g = 1 To $aActiveGroups[0]
$GrpButton[$g] = GUICtrlCreateButton($aActiveGroups[$g],-1, 1, 115, 20)
FileWrite($Logfile, _Now() & " - Group created: '" & $aActiveGroups[$g] & "'" & @CRLF)
     For $n = 1 To $aHosts[0][0]
if $aActiveGroups[$g] = $aHosts[$n][0] then $aHosts[$n][2] = GUICtrlCreateCheckbox($aHosts[$n][1],-1,0,130,15)
if $aActiveGroups[$g] = $aHosts[$n][0] then FileWrite($Logfile, _Now() & " - Host created: '" & $aHosts[$n][1] & "'")
if $aActiveGroups[$g] = $aHosts[$n][0] then $aHosts[$n][3] = IniRead($sINI, $aActiveGroups[$g], 'Share','C$')
;~ if $aActiveGroups[$g] = $aHosts[$n][0] then $aHosts[$n][4] = ping ($aHosts[$n][1],$PingTimeout)
;~ if not $aHosts[$n][4] = 1 then GUICtrlSetState ($aHosts[$n][2],$GUI_DISABLE)
if $aHosts[$n][4] = 1 then GUICtrlSetState ($aHosts[$n][2],$GUI_ENABLE)
if $aActiveGroups[$g] = $aHosts[$n][0] and not $aHosts[$n][4] = 1 then
FileWrite($Logfile, " -DISABLED" & @CRLF)
Elseif $aActiveGroups[$g] = $aHosts[$n][0] Then
FileWrite($Logfile, @CRLF)
EndIf
Next
Next
$Btn_End = GUICtrlCreateDummy()
_GUIScrollbars_Generate($cGUI, 0, ($n * 15) + ($g * 21)) ;number of checkboxes in the list * 15 pixels (height of the checkbox + spacing ???)
GUISetState()
;~ _ArrayDisplay($aActiveGroups)
;~ _ArrayDisplay($aHosts)
While 1
$msg = GUIGetMsg()
     Switch $msg
;~ If $msg = $GUI_EVENT_CLOSE Then
Case $GUI_EVENT_CLOSE
Exit
;~ ElseIf $msg = $bToggleAll Then
Case $bToggleAll
For $n = 1 To $aHosts[0][0]
             If $aHosts[$n][0] = True Then
     If ControlCommand($cGUI, "", $aHosts[$n][2], "IsEnabled") Then
                 If ControlCommand($cGUI, "", $aHosts[$n][2], "IsChecked") Then
                     ControlCommand($cGUI, "", $aHosts[$n][2], "Uncheck")
                 Else
                     ControlCommand($cGUI, "", $aHosts[$n][2], "Check")
                 EndIf
     EndIf
             EndIf
         Next

Case $bToggleAll
For $n = 1 To $aHosts[0][0]
             If $aHosts[$n][0] = True Then
     If ControlCommand($cGUI, "", $aHosts[$n][2], "IsEnabled") Then
                 If ControlCommand($cGUI, "", $aHosts[$n][2], "IsChecked") Then
                     ControlCommand($cGUI, "", $aHosts[$n][2], "Uncheck")
                 Else
                     ControlCommand($cGUI, "", $aHosts[$n][2], "Check")
                 EndIf
     EndIf
             EndIf
         Next
Case $Btn_Start To $Btn_End
For $n = 1 To $aHosts[0][0]
     If $aHosts[$n][0] = GUICtrlRead($Msg) Then
     If ControlCommand($cGUI, "", $aHosts[$n][2], "IsEnabled") Then
     If ControlCommand($cGUI, "", $aHosts[$n][2], "IsChecked") Then
                     ControlCommand($cGUI, "", $aHosts[$n][2], "Uncheck")
                 Else
                     ControlCommand($cGUI, "", $aHosts[$n][2], "Check")
                 EndIf
     EndIf
             EndIf
         Next

EndSwitch
WEnd
Func _AddActiveHost($sGrp, $sHost)
ReDim $aHosts[UBound($aHosts) + 1][UBound($aHosts, 2)] ; Resize the array
$aHosts[0][0] = UBound($aHosts) - 1 ; Save count in [0][0]
$aHosts[$aHosts[0][0]][0] = $sGrp ; Put group in [n][0]
$aHosts[$aHosts[0][0]][1] = $sHost ; Put host in [n][1]
EndFunc ;==>_AddActiveHost

GUIScrollbars_Ex.au3

Edited by Melba23
Changed tags

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Odewallrus,

You need to close the tab definition as explained in the Help file:

; .....
GUICtrlCreateTabItem("tab4")
GUICtrlCreateTabItem("") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUISetState()
' .....

M23

P.S. When you post code please use AutoIt tags - put [autoit] before and [/autoit] after your posted code. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. ;)

Edited by Melba23
Typo

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Thank you sooo very much! sorry about the tags it does read much better!

Share this post


Link to post
Share on other sites

Odewallrus,

My pleasure. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • Skeletor
      By Skeletor
      Hi Developers,
       
      While trying to find a way to actually style/skin the GUICtrlCreateTabItem, I read the help file and stated:
      My question to you guys is will this be updated? or am I hoping for something that will never come to pass?
      I've seen scripts between 2007 to 2009 allowing the tabs to be modified
      Reason for my question is I'm trying to make my GUI Tabs look more modern.
      Thanks in advance for reading my post.
       
    • antonioj84
      By antonioj84
      #include <GUIConstantsEx.au3> #include "GUIExtender.au3" $hGUI = GUICreate("Move Example", 250, 230) GUICtrlCreateGroup(" Choose Orientation ", 10, 10, 230, 80) $cRadio_Horz = GUICtrlCreateRadio(" Horizontal ", 20, 30, 100, 20) GUICtrlSetState(-1, $GUI_CHECKED) $cRadio_Vert = GUICtrlCreateRadio(" Vertical ", 20, 60, 100, 20) GUICtrlCreateGroup(" Choose Move Style ", 10, 100, 230, 110) $cRadio_0 = GUICtrlCreateRadio(" Fix Left ", 20, 120, 100, 20) $cRadio_1 = GUICtrlCreateRadio(" Fix Centre ", 20, 150, 100, 20) $cRadio_2 = GUICtrlCreateRadio(" Fix Right ", 20, 180, 100, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cRadio_Horz GUICtrlSetData($cRadio_0, " Fix Left ") GUICtrlSetState($cRadio_0, $GUI_UNCHECKED) GUICtrlSetState($cRadio_1, $GUI_UNCHECKED) GUICtrlSetData($cRadio_2, " Fix Right ") GUICtrlSetState($cRadio_2, $GUI_UNCHECKED) Case $cRadio_Vert GUICtrlSetData($cRadio_0, " Fix Top ") GUICtrlSetState($cRadio_0, $GUI_UNCHECKED) GUICtrlSetState($cRadio_1, $GUI_UNCHECKED) GUICtrlSetData($cRadio_2, " Fix Bottom ") GUICtrlSetState($cRadio_2, $GUI_UNCHECKED) Case $cRadio_0 _Create_GUI(0) Case $cRadio_1 _Create_GUI(1) Case $cRadio_2 _Create_GUI(2) EndSwitch WEnd Func _Create_GUI($iMove) Local $sTitle Switch $iMove Case 0 If GUICtrlRead($cRadio_Horz) = 1 Then $sTitle = "Fixed Left" Else $sTitle = "Fixed Top" EndIf Case 1 $sTitle = "Fixed Centre" Case 2 If GUICtrlRead($cRadio_Horz) = 1 Then $sTitle = "Fixed Right" Else $sTitle = "Fixed Bottom" EndIf EndSwitch GUISetState(@SW_HIDE, $hGUI) $hGUI_Ex = GUICreate($sTitle, 500, 500) If GUICtrlRead($cRadio_Horz) = 1 Then _GUIExtender_Init($hGUI_Ex, 1, $iMove) _GUIExtender_Section_Create($hGUI_Ex, 0, 250) _GUIExtender_Section_Activate($hGUI_Ex, 2, "", "", 220, 10, 20, 20) _GUIExtender_Section_Create($hGUI_Ex, 250, 250) GUICtrlCreateLabel("", 250, 0, 250, 500) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI_Ex, -99) Else _GUIExtender_Init($hGUI_Ex, 0, $iMove) _GUIExtender_Section_Create($hGUI_Ex, 250, 0) _GUIExtender_Section_Activate($hGUI_Ex, 2, "", "", 470, 220, 20, 20) _GUIExtender_Section_Create($hGUI_Ex, 250, 250) GUICtrlCreateLabel("", 0, 250, 500, 250) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI_Ex, -99) EndIf _GUIExtender_Section_Action($hGUI_Ex, 2, False) GUISetState() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[0] Case $GUI_EVENT_CLOSE GUISetState(@SW_SHOW, $hGUI) GUIDelete($hGUI_Ex) _GUIExtender_Clear($hGUI_Ex) ExitLoop EndSwitch _GUIExtender_EventMonitor($aMsg[1], $aMsg[0]) ; Check for click on Action control WEnd EndFunc I am trying to implement 2 side window toggle hide and show with 2 different menu.  can someone give me some direction  thanks

    • Tarakesh
      By Tarakesh
      Hi,
      First of all I would like say infinite thanks to the team involved in designing this great tool.
      Here is my problem
      1. Press windows button
      2. ESC
      3. TAB
      4. It will take me to the first pinned icon in the taskbar
      5. If I I do SHIFT F10 which usually opens context menu like  right click of the mouse.
      6. For one of the application I am using it does not support  Shift + F10 context menu rather it listens to only mouse right click event.
      7. I do a search in a tree view of my application and the search item is selected or focused
      8. For eg

           User1

           User2
           User3
      Now if I search for User1 the tab or focus move to User 1 (Red)
           User1

           User2
           User3
      If I search for User3 the tab or focus moves to User 3
      Now my question is how can I move the mouse automatically go to the focused item on the window. Such that during automation I can issue MoveClick("{RIGHT}") as {SHIFT F10} is not working from the keyboard. It is a java app, unfortunately it is not honoring the right click events from keyboard to open the context

      WinMinimizeAll();
      Send("^{ESC}")
      Sleep(200)
      Send("{ESC}")
      Send("{TAB}")

      the above scripts take the tab to the first pinned icon in the taskbar. Now i want
      MouseMove( "move to tab" selection")

      Regards,
      Tarakesh
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening guys ( almost good night here in Italy )  
      How are you? Hop you're fine  
      I'm trying to do a Login Form ( I did, but I'm missing something in the management ), that allows the user to login when the script is launched, and, when the main GUI is opened, the user can Logout and Login with another username and password.
      The username and password "checking" I do is done by a text file, which in there are username and password, crypted through _Crypt_EncryptData().
      The "issue" I'm having at the moment, is to manage the Login form when the user hasn't already done the login, and so, the main GUI is not visible, but is created...
      I create the main GUI after the Login form... I tried with WinActive, WinGetState, but nothing changed ( even at the first Login, the script says ( through a MsgBox ) that the Win does exists ( or is active... ) and, as I want, it is not shown again...

      I really don't know If I missed something, or, I don't know...
      I'm going crazy for this thing...
      If someone could help me, I'd really appreaciate it!
      Thanks for the reading
      #Region ### START Koda GUI section ### Form=C:\Users\Portatile-60\Documents\Documenti Lavoro\AutoIt\Gestione_Magazzino_v2\form_Login.kxf Global $form_Login = GUICreate("Effettua il Login per continuare:", 405, 120, @DesktopWidth/2 - 202.5, @DesktopHeight/2 - 150) ; 302, 218 GUISetOnEvent($GUI_EVENT_CLOSE, "GUIDeleteLogin") Global $combo_Username = GUICtrlCreateCombo("Di Muro Francesco", 104, 64, 217, 25) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetData($combo_Username, "somedata") Global $input_Password = GUICtrlCreateInput("", 104, 89, 217, 25, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $button_VerificaDati = GUICtrlCreateButton("", 328, 66, 42, 42, $BS_ICON) GUICtrlSetImage(-1, "C:\Users\Portatile-60\Documents\Documenti Lavoro\AutoIt\Gestione_Magazzino_v2\Icone\icon_check.ico", -1) GUICtrlSetOnEvent($button_VerificaDati, "CheckLogin") $label_Titolo = GUICtrlCreateLabel("Login", 167, 14, 71, 33) GUICtrlSetFont(-1, 18, 800, 0, "Arial") $label_Username = GUICtrlCreateLabel("Username :", 24, 64, 76, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $label_Password = GUICtrlCreateLabel("Password :", 24, 89, 73, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") #EndRegion ### END Koda GUI section ### Func CheckLogin() Local $sUsername = GUICtrlRead($combo_Username) Local $sPassword = GUICtrlRead($input_Password) MsgBox($MB_ICONINFORMATION, "", "Username: " & $sUsername & @CRLF & "Password: " & $sPassword) Local $sFileUtenti = @ScriptDir & "\utenti.txt" If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante la lettura del file!") Exit Else Local $hFileUtenti = FileOpen($sFileUtenti, $FO_READ) If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante l'apertura del file " & $sFileUtenti & "." & @CRLF & "Errore: " & @error) Else Local $sDatiUtente, $aDatiUtente Local $bUtenteTrovato = False Local $iLinea = 1 Local $sControlloWin = "" Local $sWin = WinGetState($form_GestioneMagazzino) MsgBox($MB_ICONINFORMATION, "", $sWin) If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante la verifica della GUI attiva." & @CRLF & "Errore: " & @error) EndIf If($sWin == 5) Then MsgBox($MB_ICONINFORMATION, "", "La GUI esiste!") Do $sDatiUtente = FileReadLine($hFileUtenti, $iLinea) $aDatiUtente = StringSplit($sDatiUtente, "|", $STR_NOCOUNT) If(BinaryToString(_Crypt_DecryptData($aDatiUtente[0], "CRYPT", $CALG_RC4)) = $sUsername And BinaryToString(_Crypt_DecryptData($aDatiUtente[1], "CRYPT", $CALG_RC4)) = $sPassword) Then $sControlloWin = "ESISTE" $bUtenteTrovato = True ExitLoop Else $iLinea+=1 If($sDatiUtente = "" And $bUtenteTrovato = False) Then MsgBox($MB_ICONWARNING, "Attenzione!", "Username o Password errati.") ExitLoop EndIf EndIf Until $bUtenteTrovato = True Else MsgBox($MB_ICONINFORMATION, "", "La GUI esiste!") Do $sDatiUtente = FileReadLine($hFileUtenti, $iLinea) $aDatiUtente = StringSplit($sDatiUtente, "|", $STR_NOCOUNT) If(BinaryToString(_Crypt_DecryptData($aDatiUtente[0], "CRYPT", $CALG_RC4)) = $sUsername And BinaryToString(_Crypt_DecryptData($aDatiUtente[1], "CRYPT", $CALG_RC4)) = $sPassword) Then $sControlloWin = "NON ESISTE" $bUtenteTrovato = True ExitLoop Else $iLinea+=1 If($sDatiUtente = "" And $bUtenteTrovato = False) Then MsgBox($MB_ICONWARNING, "Attenzione!", "Username o Password errati.") ExitLoop EndIf EndIf Until $bUtenteTrovato = True EndIf If($sControlloWin = "ESISTE") Then MsgBox($MB_ICONINFORMATION, "Login effettuato!", "Hai effettuato l'accesso come: " & @CRLF & $sUsername & ".") ; Setta come "non-cliccabile" il bottone di Login GUICtrlSetState($button_Login, $GUI_DISABLE) GUICtrlSetState($button_VisualizzaGiacenze, $GUI_ENABLE) GUICtrlSetState($button_AggiungiProdotto, $GUI_ENABLE) GUICtrlSetState($button_PrelevaProdotto, $GUI_ENABLE) GUICtrlSetState($button_RicercaProdotto, $GUI_ENABLE) GUICtrlSetState($button_CreaDDT, $GUI_ENABLE) GUICtrlSetState($button_MostraGiacenzeAZero, $GUI_ENABLE) GUICtrlSetState($combo_Magazzino, $GUI_ENABLE) GUICtrlSetState($button_Logout, $GUI_ENABLE) ; Setta come "non-cliccabile" il bottone di Login GUICtrlSetState($button_Login, $GUI_DISABLE) ; Setta l'utente che ha effettuato l'accesso nella label $label_CaptionUtente GUICtrlSetData($label_CaptionUtente, $sUsername) ; "Distruggi" la GUI Login GUIDelete($form_Login) FileClose($hFileUtenti) Else MsgBox($MB_ICONINFORMATION, "", "La GUI non esiste!") MsgBox($MB_ICONINFORMATION, "Login effettuato!", "Hai effettuato l'accesso come: " & @CRLF & $sUsername & ".") ; Mostra la GUI Principale GUISetState(@SW_SHOW, $form_GestioneMagazzino) ; Setta come "non-cliccabile" il bottone di Login GUICtrlSetState($button_Login, $GUI_DISABLE) ; Setta l'utente che ha effettuato l'accesso nella label $label_CaptionUtente GUICtrlSetData($label_CaptionUtente, $sUsername) ; "Distruggi" la GUI Login GUIDelete($form_Login) FileClose($hFileUtenti) EndIf EndIf EndIf EndFunc Func Logout() GUICtrlSetData($label_CaptionUtente, "") MsgBox($MB_ICONINFORMATION, "Logout effettuato!", "Effettua nuovamente il Login per utilizzare il programma.") ; Disabilita tutti i bottoni della GUI Principale GUICtrlSetState($button_VisualizzaGiacenze, $GUI_DISABLE) GUICtrlSetState($button_AggiungiProdotto, $GUI_DISABLE) GUICtrlSetState($button_PrelevaProdotto, $GUI_DISABLE) GUICtrlSetState($button_RicercaProdotto, $GUI_DISABLE) GUICtrlSetState($button_CreaDDT, $GUI_DISABLE) GUICtrlSetState($button_MostraGiacenzeAZero, $GUI_DISABLE) GUICtrlSetState($combo_Magazzino, $GUI_DISABLE) GUICtrlSetState($button_Logout, $GUI_DISABLE) ; Abilita il Login GUICtrlSetState($button_Login, $GUI_ENABLE) EndFunc EDIT:
      Solved, making an "integrated" Login form... 
    • mutleey
      By mutleey
      Hello everybody, I have a problem here ... I need to generate a form of sale and print quality using the form I could do is not getting good, I created a window without borders with the fields I need, then use the function _ScreenCapture_CaptureWnd () to generate a print of this window and send the image to the printer using the UDF printMGv2.au3, the problem is that to get a good quality I would have to create a huge window to get the print, any suggestions to print this form with a good quality?
      thank you...
      example of the form it takes: