Jump to content

Trouble using Tabs with Scrollbars


cdjphoenix
 Share

Go to solution Solved by Melba23,

Recommended Posts

I am currently working on a program to grab system info and software licenses and I've hit a problem with tabs and scrollbars. What I am trying to do is have a tab for each catagory like, Memory, Hard Drives, Processors. I have the tabs and info working the way i want but since some of these tabs have a lot of information on them I would like them to be scrollable. I am using Melba23's UDF for scrollbars so that I dont make this any harder that it needs to be. When I add the scrollbars they show up as I want but then the first tab appears blank. I can then click on the 2nd tab and scroll as i want. The odd thing is after select tab2 and then go back tab1, tab1 has all of it's info back. I've gone as far as i can on solving this problem and would aprieciate any help i can get.

Here is what i have so far.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.8.1
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <File.au3>
#include <GUIConstantsEx.au3>
#include "GUIScrollbars_Ex.au3"

Global $CSArray = Win32_ComputerSystem()
Global $MemArray = Win32_PhysicalMemory()
Global $OSArray = Win32_OperatingSystem()
Global $ProcArray = win32_processor()
Global $HDDArray = Win32_LogicalDisk()
Global $AntiVirusArray = Antivirus()
Global $OfficeVersion = MSOffice()
Global $OfficeKey = OfficeKey()
Global $SoftwareTest = SWTest()

Global $hGuiWin = GUICreate ( "System Info", 420, 500)
$SaveButton = GUICtrlCreateButton("Save ", 250, 960, 75)
_GUIScrollbars_Generate($hGuiWin, 390, 1000, 0, 0, True)
GUISetState()

$hTab = GUICtrlCreateTab(10, 10, 400, 900)

$tab1 = GUICtrlCreateTabItem("General")
GUICtrlCreateLabel("User Name: " & @UserName, 15,40)
GUICtrlCreateLabel("Machine Name: " & $CSArray[0], 15,60)
GUICtrlCreateLabel("Domain: " & $CSArray[1], 15,80)
GUICtrlCreateLabel("Manufacturer: " & $CSArray[2], 15,100)
GUICtrlCreateLabel("Model: " & $CSArray[3], 15,120)
GUICtrlCreateLabel("Operating System: " & $OSArray[0] & " " & $OSArray[1], 15,140)


$tab2 = GUICtrlCreateTabItem("Drives")
GUICtrlCreateLabel($HDDArray, 15,40)

$tab3 = GUICtrlCreateTabItem("Memory")
GUICtrlCreateLabel($MemArray[0], 15,40)

$tab4 = GUICtrlCreateTabItem("Processor")
GUICtrlCreateLabel("Processor: " & $ProcArray[0], 15,40)
GUICtrlCreateLabel("Device ID: " & $ProcArray[1], 15,60)
GUICtrlCreateLabel("Socket: " & $ProcArray[2], 15,80)
GUICtrlCreateLabel("Max CLock Speed: " & $ProcArray[3], 15,100)

$tab5 = GUICtrlCreateTabItem("Software")
GUICtrlCreateLabel("AntiVirus:  " & $AntiVirusArray[0], 15,40)
GUICtrlCreateLabel("Office Version: " & $OfficeVersion, 15,60)
GUICtrlCreateLabel("Office Key: " & $OfficeKey, 15,80)
If StringInStr($SoftwareTest[0],"QuickBooks") Then
   $QuickBooksTest = "QuickBooks is installed"
Else
   $QuickBooksTest = "QuickBooks not installed"
EndIf   
GUICtrlCreateLabel($QuickBooksTest, 15,100)

;GUICtrlCreateLabel("
;GUICtrlCreateLabel("


;GUISetState(@SW_SHOW)


While 3
    $msg = GUIGetMsg()
    Select
      Case $msg = $RebootButton2

      Case $msg = $CancelRebootButton
         GUISetState(@SW_HIDE)
         ExitLoop
      Case $msg = $SaveButton
         Local $file = FileOpen(@ComputerName & " SysInfo.txt" , 1)
         MsgBox(0,"Debug Msg", "Debug Msg")
         FileWriteLine($file, "Username: " & @username)
         FileWriteLine($file, "Machine Name: " & $CSArray[0])
         FileWriteLine($file, "Domain: " & $CSArray[1])
         FileWriteLine($file, "Manufacturer: " & $CSArray[2])
         FileWriteLine($file, "Operating System: " & $OSArray[0] & " " & $OSArray[1])
         FileWriteLine($file, " ")
         FileWriteLine($file, $HDDArray)
         FileWriteLine($file, " ")
         FileWriteLine($file, $MemArray[0])
         FileWriteLine($file, " ")
         FileWriteLine($file, "Proccessor: " & $ProcArray[0])
         FileWriteLine($file, "Proccessor ID: " & $ProcArray[1])
         FileWriteLine($file, "Socket Type: " & $ProcArray[2])
         FileWriteLine($file, "Max CLock Speed: " & $ProcArray[3])
         FileWriteLine($file, " ")
         FileWriteLine($file, "AntiVirus: " & $AntiVirusArray[0])
         FileWriteLine($file, " ")
         FileWriteLine($file, "Office Version: " & $OfficeVersion)
         FileWriteLine($file, "Office License: " &  $OfficeKey)
         FileWriteLine($file, " ")
         FileWriteLine($file,$QuickBooksTest)
         ;FileWriteLine($file,
         FileClose($file)
      
    EndSelect
WEnd

;Do
;    $msg = GUIGetMsg()
;    Select
;    Case $msg = $SaveButton






;GENERAL INFO GENERAL INFO GENERAL INFO GENERAL INFO GENERAL INFO GENERAL INFO GENERAL INFO GENERAL INFO GENERAL INFO GENERAL INFO GENERAL INFO

Func Win32_ComputerSystem()
    Local $oWMIService = ObjGet("winmgmts:\\.\")

    Local $oColItems = $oWMIService.ExecQuery("Select * From Win32_ComputerSystem", "WQL", 0x30)
    Local $CSDescription[4]

    If IsObj($oColItems) Then
        For $oObjectItem In $oColItems
            $CSDescription[0] &= $oObjectItem.Name
            $CSDescription[1] &= $oObjectItem.Domain
            $CSDescription[2] &= $oObjectItem.Manufacturer
            $CSDescription[3] &= $oObjectItem.Model
        Next

        Return $CSDescription
    EndIf

    Return SetError(1, 1, 0)
 EndFunc

 ;MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO MEMORY INFO

Func Win32_PhysicalMemory()
    Local $oWMIService = ObjGet("winmgmts:\\.\")

    Local $oColItems = $oWMIService.ExecQuery("Select * From Win32_PhysicalMemory", "WQL", 0x30)
    Local $MemDescription[4]

    If IsObj($oColItems) Then
        For $oObjectItem In $oColItems
            $MemDescription[0] &= $oObjectItem.banklabel & @CRLF & "Manufacturer: " & $oObjectItem.manufacturer & @CRLF & "Size: " & ($oObjectItem.capacity / 1024 ^ 3) & "GB" & @CRLF & "Part Number: " & $oObjectItem.partnumber & @CRLF & @CRLF
            ;$MemDescription[1] &= $oObjectItem.manufacturer
            ;$MemDescription[2] &= $oObjectItem.capacity
            ;$MemDescription[3] &= $oObjectItem.partnumber
        Next

        Return $MemDescription
    EndIf

    Return SetError(1, 1, 0)
EndFunc

;OPERATING SYSTEM INFO OPERATING SYSTEM INFO OPERATING SYSTEM INFO OPERATING SYSTEM INFO OPERATING SYSTEM INFO OPERATING SYSTEM INFO OPERATING SYSTEM INFO

Func Win32_OperatingSystem()
    Local $oWMIService = ObjGet("winmgmts:\\.\")

    Local $oColItems = $oWMIService.ExecQuery("Select * From Win32_OperatingSystem", "WQL", 0x30)
    Local $OSDescription[4]

    If IsObj($oColItems) Then
        For $oObjectItem In $oColItems
            $OSDescription[0] &= $oObjectItem.Caption
            $OSDescription[1] &= $oObjectItem.OSArchitecture
        Next

        Return $OSDescription
    EndIf

    Return SetError(1, 1, 0)
 EndFunc

;PROCESSOR INFO PROCESSOR INFO PROCESSOR INFO PROCESSOR INFO PROCESSOR INFO PROCESSOR INFO PROCESSOR INFO PROCESSOR INFO PROCESSOR INFO PROCESSOR INFO

Func win32_processor()
    Local $oWMIService = ObjGet("winmgmts:\\.\")

    Local $oColItems = $oWMIService.ExecQuery("Select * From win32_processor", "WQL", 0x30)
    Local $ProcDescription[4]

    If IsObj($oColItems) Then
        For $oObjectItem In $oColItems
            $ProcDescription[0] &= $oObjectItem.Name
            $ProcDescription[1] &= $oObjectItem.DeviceID
            $ProcDescription[2] &= $oObjectItem.SocketDesignation
            $ProcDescription[3] &= ($oObjectItem.MaxClockSpeed / 1000 & "GHz")
        Next

        Return $ProcDescription
    EndIf

    Return SetError(1, 1, 0)
 EndFunc

;HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO HDD INFO

Func Win32_LogicalDisk()


   Local $HDDdescription
   $strComputer = "."


   $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
   $colItems = $objWMIService.ExecQuery("Select * from Win32_LogicalDisk")
   For $objItem In $colItems
      $HDDdescription &= "Drive Letter: " & $objItem.DeviceID & @CRLF & _
               "Size: " & Int($objItem.Size / 1024 ^ 3) & "GB" & @CRLF & _
               "Free Space: " & Int($objItem.FreeSpace / 1024 ^ 3) & "GB" & @CRLF  & _
               "Mapped Drive: " & ($objItem.ProviderName) & @CRLF & @CRLF

   Next
   Return $HDDdescription
EndFunc

 ;AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus AntiVirus
Func AntiVirus()
   Local $AntiVirusDiscription[4]
   $oWMI = ObjGet("winmgmts:\\localhost\root\SecurityCenter2")
   $colItems = $oWMI.ExecQuery("Select * from AntiVirusProduct where not displayname= 'Windows Defender'")

   For $objAntiVirusProduct In $colItems
    $AntiVirusDiscription[0] = $objAntiVirusProduct.DisplayName

   Next
   Return $AntiVirusDiscription
EndFunc

;MS Office Info MS Office Info MS Office Info MS Office Info MS Office Info MS Office Info MS Office Info MS Office Info MS Office Info MS Office Info
;MVP

;MsgBox(0, '', MSOffice())

Func MSOffice()
   Dim $ls_key, $ls_return, $ls_pom, $ls_name, $ls_ver1, $ls_ver2, $ls_ver3, $ls_subkey, $ls_value
   Dim $n, $ul_pom
   ; 1) first quick check if Office installed and get approximate version
   $ls_key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office"
   $n = 1

   While 1
      $ls_subkey = RegEnumKey($ls_key, $n)
      If @error Then ExitLoop

      $ls_value = RegEnumKey($ls_key & "\" & $ls_subkey & "\Registration", 1)
      If Not @error Then
         $ls_ver1 = $ls_subkey ; 14.0
         $ls_return = 'Microsoft Office ' + $ls_subkey
         ExitLoop
      EndIf
      $n += 1
   WEnd

   If $ls_return = '' Then Return '' ; isn't Office

   ; 2) check exact name/version from Uninstall
   $ls_key = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"
   $n = 0

   While 1
      $n += 1
      $ls_subkey = RegEnumKey($ls_key, $n)
      If @error Then ExitLoop
         $ls_name = RegRead($ls_key & "\" & $ls_subkey, "DisplayName")
      If @error Then ContinueLoop
      ; skip other applications than Office and also Office components
      If Not (StringInStr($ls_name, 'Microsoft Office') > 0 And StringInStr($ls_name, 'Web Components') = 0) Then ContinueLoop

      $ls_pom = RegRead($ls_key & "\" & $ls_subkey, "ParentKeyName")
      If Not @error Then ContinueLoop ; skip those With Parent
      $ul_pom = RegRead($ls_key & "\" & $ls_subkey, "SystemComponent")
      If Not @error And $ul_pom = 1 Then ContinueLoop ; skip SystemComponents = 1 - - > MUI(Czech), ...
      $ls_ver2 = RegRead($ls_key & "\" & $ls_subkey, "DisplayVersion")
      If @error Then ContinueLoop ; skip those without version
         ; note: base version number must be the same with the one from first step
         ; Microsoft Office Professional Plus 2010 (14.0.4763.1000)
      If StringLeft($ls_ver2, StringLen($ls_ver1)) = $ls_ver1 Then
         ; 3) beware: in registry there isn't version included service packs, therefore check exact version from EXE? (14.0.6106.5005) - SP1
         ; InstallLocation - C:\Program Files (x86)\Microsoft Office\             ;       ls_ver3 = ...
         ;Return $ls_name
         Return $ls_name & ' (' & $ls_ver2 & ')'
      EndIf
   WEnd
   ; if not found exact version from Uninstall, then return at least approximate version from first step
   Return $ls_return
EndFunc   ;==>uf_get_office_ver

;Office Key Office Key Office Key Office Key Office Key Office Key Office Key Office Key Office Key Office Key Office Key Office Key

Func OfficeKey()

Local $sKey[29], $Value = 0, $hi = 0, $n = 0, $i = 0, $dlen = 29, $slen = 15, $Result, $bKey, $iKeyOffset = 52, $RegKey

if StringInStr($OfficeVersion,"XP") Then
            $RegKey = 'HKLM\SOFTWARE\Microsoft\Office\10.0\Registration'
            If @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\10.0\Registration'
            For $i = 1 To 100
                $var = RegEnumKey($RegKey, $i)
                If @error <> 0 Then ExitLoop
                $bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
                If Not @error Then ExitLoop
            Next

ElseIf StringInStr($OfficeVersion,"2003") Then
            $RegKey = 'HKLM\SOFTWARE\Microsoft\Office\11.0\Registration'
            If @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\11.0\Registration'
            For $i = 1 To 100
                $var = RegEnumKey($RegKey, $i)
                If @error <> 0 Then ExitLoop
                $bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
                If Not @error Then ExitLoop
            Next

ElseIf StringInStr($OfficeVersion,"2007") Then
            $RegKey = 'HKLM\SOFTWARE\Microsoft\Office\12.0\Registration'
            If @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\12.0\Registration'
            For $i = 1 To 100
                $var = RegEnumKey($RegKey, $i)
                If @error <> 0 Then ExitLoop
                $bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
                If Not @error Then ExitLoop
            Next

ElseIf StringInStr($OfficeVersion,"2010") Then
            $RegKey = 'HKLM\SOFTWARE\Microsoft\Office\14.0\Registration'
            If @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Registration'
            For $i = 1 To 100
                $var = RegEnumKey($RegKey, $i)
                If @error <> 0 Then ExitLoop
                $bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
                If Not @error Then ExitLoop
            Next
            $iKeyOffset = 0x328

ElseIf StringInStr($OfficeVersion,"2013") Then
            $RegKey = 'HKLM\SOFTWARE\Microsoft\Office\15.0\Registration'
            If @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Registration'
            For $i = 1 To 1024
                $var = RegEnumKey($RegKey, $i)
                If @error <> 0 Then ExitLoop
                $bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
                If Not @error Then ExitLoop
            Next
            $iKeyOffset = 0x328

EndIf

    If Not BinaryLen($bKey) Then Return ""

    Local $aKeys[BinaryLen($bKey)]
    For $i = 0 To UBound($aKeys) - 1
        $aKeys[$i] = Int(BinaryMid($bKey, $i + 1, 1))
    Next

Local Const $isWin8 = BitAND(BitShift($aKeys[$iKeyOffset + 14], 3), 1)
$aKeys[$iKeyOffset + 14] = BitOR(BitAND($aKeys[$iKeyOffset + 14], 0xF7), BitShift(BitAND($isWin8, 2), -2))

    $i = 24
    Local $sChars = "BCDFGHJKMPQRTVWXY2346789", $iCur, $iX, $sKeyOutput, $iLast
    While $i > -1
        $iCur = 0
        $iX = 14
        While $iX > -1
$iCur = BitShift($iCur, -8)
$iCur = $aKeys[$iX + $iKeyOffset] + $iCur
            $aKeys[$iX + $iKeyOffset] = Int($iCur / 24)
            $iCur = Mod($iCur, 24)
            $iX -= 1
        WEnd
        $i -= 1
        $sKeyOutput = StringMid($sChars, $iCur + 1, 1) & $sKeyOutput
        $iLast = $iCur
    WEnd

    If $isWin8 Then
        $sKeyOutput = StringMid($sKeyOutput, 2, $iLast) & "N" & StringTrimLeft($sKeyOutput, $iLast + 1)
    EndIf

$FinalKey = StringRegExpReplace($sKeyOutput, '(\w{5})(\w{5})(\w{5})(\w{5})(\w{5})', '\1-\2-\3-\4-\5')
Return $FinalKey
EndFunc

;Software Installed Test Software Installed Test Software Installed Test Software Installed Test Software Installed Test Software Installed Test

Func SWTest()
    Local $oWMIService = ObjGet("winmgmts:\\.\")

    Local $oColItems = $oWMIService.ExecQuery("Select * From Win32_Product", "WQL", 0x30)
    Local $SWDescription[4]

    If IsObj($oColItems) Then
        For $oObjectItem In $oColItems
            $SWDescription[0] &= $oObjectItem.Name
            $SWDescription[1] &= $oObjectItem.Vendor
            $SWDescription[2] &= $oObjectItem.Version
            $SWDescription[3] &= $oObjectItem.Caption
        Next

        Return $SWDescription
    EndIf

    Return SetError(1, 1, 0)
 EndFunc
Edited by cdjphoenix
Link to comment
Share on other sites

  • Moderators

cdjphoenix,

Where is the rest of the script? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • Moderators
  • Solution

cdjphoenix,

I wanted to see if you closed the tabitem structure - you do not, and that often leads to display problems. Try adding this line before the While loop: :)

GUICtrlCreateTabItem(""); end tabitem definition
Any luck? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

It works! I was hoping that it was just a line of code and not an entire section that i managed to break. Although, I have one follow up question. Right now when you open the program it starts on tab5 insted of tab1, is there a way to change this? Thanks again for you help.

Link to comment
Share on other sites

  • Moderators

cdjphoenix,

Look at the example for GUICtrlCreateTabItem in the Help file amd you will see how to use GUICtrlSetState to determine the tab to display. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

Thanks, I believe i have found what you were talking about.. Although, it does not seem to be working for me. From what I understand from the help file is that you need to add

GUICtrlSetState(-1, $GUI_SHOW)

  under the tab you wish to be dislplayed first. For example my script would look like:

$hTab = GUICtrlCreateTab(10, 10, 400, 900)

$tab1 = GUICtrlCreateTabItem("General")
GUICtrlSetState(-1,$GUI_SHOW)
GUICtrlCreateLabel("User Name: " & @UserName, 15,40)
GUICtrlCreateLabel("Machine Name: " & $CSArray[0], 15,60)
GUICtrlCreateLabel("Domain: " & $CSArray[1], 15,80)
GUICtrlCreateLabel("Manufacturer: " & $CSArray[2], 15,100)
GUICtrlCreateLabel("Model: " & $CSArray[3], 15,120)
GUICtrlCreateLabel("Operating System: " & $OSArray[0] & " " & $OSArray[1], 15,140)


$tab2 = GUICtrlCreateTabItem("Drives")
GUICtrlCreateLabel($HDDArray, 15,40)

$tab3 = GUICtrlCreateTabItem("Memory")
GUICtrlCreateLabel($MemArray[0], 15,40)

$tab4 = GUICtrlCreateTabItem("Processor")
GUICtrlCreateLabel("Processor: " & $ProcArray[0], 15,40)
GUICtrlCreateLabel("Device ID: " & $ProcArray[1], 15,60)
GUICtrlCreateLabel("Socket: " & $ProcArray[2], 15,80)
GUICtrlCreateLabel("Max CLock Speed: " & $ProcArray[3], 15,100)

$tab5 = GUICtrlCreateTabItem("Software")
GUICtrlCreateLabel("AntiVirus:  " & $AntiVirusArray[0], 15,40)
GUICtrlCreateLabel("Office Version: " & $OfficeVersion, 15,60)
GUICtrlCreateLabel("Office Key: " & $OfficeKey, 15,80)

If StringInStr($SoftwareTest[0],"QuickBooks") Then
   $QuickBooksTest = "QuickBooks is installed"
Else
   $QuickBooksTest = "QuickBooks not installed"
EndIf   
GUICtrlCreateLabel($QuickBooksTest, 15,100)

;GUICtrlCreateLabel("
;GUICtrlCreateLabel("


GUISetState(@SW_SHOW)
GUICtrlCreateTabItem("")

Did i miss something interpret that wrong or did i miss something real simple? Thanks again for all your help. :thumbsup:

Edited by cdjphoenix
Link to comment
Share on other sites

  • Moderators

cdjphoenix,

That is it - although I would recommend using the ControlID rather than the "-1" shorthand if you have it. I also tend to place the line after the end of the tab structure creation - like this: ;)

#include <GUIConstantsEx.au3>
#include <GUIScrollbars_Ex.au3>

Global $hGuiWin = GUICreate ( "System Info", 420, 500)
$SaveButton = GUICtrlCreateButton("Save ", 250, 960, 75)
_GUIScrollbars_Generate($hGuiWin, 400, 1000, 0, 0, True)

$hTab = GUICtrlCreateTab(10, 10, 400, 900)

$tab1 = GUICtrlCreateTabItem("General")
GUICtrlCreateLabel("General", 40, 40)

$tab2 = GUICtrlCreateTabItem("Drives")
GUICtrlCreateLabel("Drives", 40, 40)

$tab3 = GUICtrlCreateTabItem("Memory")
GUICtrlCreateLabel("Memory", 40, 40)

$tab4 = GUICtrlCreateTabItem("Processor")
GUICtrlCreateLabel("Processor", 40, 40)

$tab5 = GUICtrlCreateTabItem("Software")
GUICtrlCreateLabel("Software", 40, 40)

GUICtrlCreateTabItem("")

GUICtrlSetState($tab4, $GUI_SHOW) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

GUISetState(@SW_SHOW)

While 3
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
That works for me - I can set the any of the tabs to display on start. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...