Sign in to follow this  
Followers 0
HockeyFan

Disable GUI Labels if Radio Button is disabled

6 posts in this topic

#1 ·  Posted (edited)

Hello,

Would someone be so kind as to offer some help with how I can disable a set of GUI Labels if the a certain Radio Button is disabled?

When the GUI is displayed, I have set criteria to disable the radio buttons if the drive information equals "C:" or "Network" but I'm having difficulty disableing the row of GUI Labels associated with that radio button.

Here is the code that I have so far...

#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <File.au3>

Opt("GUIOnEventMode", 1)  ;0=disabled, 1=OnEvent mode enabled

HotKeySet("!n", "_EnableNetworkDrive")  ;Alt-n

Global $Path = "C:\Program Files\Program\"
If @OSVersion = "WIN_7" Then
    $Path = "C:\Program Files (x86)\Program\"
EndIf

$ShowDrivesGUIForm = GUICreate("", 846, 481, -1, -1, 0, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$ShowDrivesGUILabel1 = GUICtrlCreateLabel("Banner", 10, 10, 820, 33, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 16, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel1 = GUICtrlCreateLabel('( Instructions )', 10, 45, 812, 33, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 10, 800, 0, "Arial")
GUICtrlSetColor(-1, 0xFF0000)
$ShowDrivesGroup = GUICtrlCreateGroup("", 10, 80, 825, 281)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
$ShowDrivesLabel2 = GUICtrlCreateLabel("Drive:", 60, 105, 50, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel3 = GUICtrlCreateLabel("Volume Name:", 130, 105, 200, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowdrivesLabel4 = GUICtrlCreateLabel("Drive Type:", 290, 105, 111, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowdrivesLabel5 = GUICtrlCreateLabel("Drive Size (GB):", 419, 105, 115, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDriveLabel6 = GUICtrlCreateLabel("Free Space (GB):", 547, 105, 127, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel7 = GUICtrlCreateLabel("Status:", 701, 105, 111, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$ShowDrivesOKButton = GUICtrlCreateButton("OK", 369, 384, 107, 41)
GUICtrlSetFont(-1, 14, 800, 0, "Arial")
GUICtrlSetState(-1, $GUI_DISABLE)
;GUISetState(@SW_SHOW)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###

GUICtrlSetOnEvent($ShowDrivesOKButton, "_Exit")

Local $aArray = DriveGetDrive("ALL")    ;Type of drive to find: "ALL", "CDROM", "REMOVABLE", "FIXED", "NETWORK", "RAMDISK", or "UNKNOWN"

If @error Then
    ; An error occurred when retrieving the drives.
    MsgBox(4096, "Error", "A fatal error has occured.")
    Exit
EndIf

Local $sList

Global $Radios[$aArray[0] + 1] = [$aArray[0]] ; [0] = count
Global $Label[$aArray[0] + 1] = [$aArray[0]] ; [0] = count

Global $iX = 42 ; Starting X-pos
Global $iY = 132 ; Starting Y-pos

Global $yTop = 136

For $aX = 1 To $Radios[0]
    $Radios[$aX] = GUICtrlCreateRadio(" " & StringUpper($aArray[$aX]), $iX, $iY, 60, 30)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetOnEvent(-1, "_EnableOKButton")
    
    $Label[$aX] = GUICtrlCreateLabel(" " & DriveGetLabel($aArray[$aX]), 130, $yTop, 200-50, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    If GUICtrlRead(-1) = " " & "" Then GUICtrlSetData(-1, StringUpper(" " & $aArray[$aX]))
    $DriveC = GUICtrlRead($Label[$aX])
    If $DriveC = " " & "C:" Then GUICtrlSetState($Radios[$aX], $GUI_DISABLE)

    $Label[$aX] = GUICtrlCreateLabel(" " & DriveGetType($aArray[$aX]), 335-45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $DriveType = GUICtrlRead($Label[$aX])
    If $DriveType = " " & "Network" Then GUICtrlSetState($Radios[$aX], $GUI_DISABLE)
    ;If $DriveType = " " & "Network" Then GUICtrlSetState($Label[$aX], $GUI_DISABLE)

    $Label[$aX] = GUICtrlCreateLabel(" " & Int(DriveSpaceTotal($aArray[$aX]) / 1000), 464-45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)

    $Label[$aX] = GUICtrlCreateLabel(" " & Int(DriveSpaceFree($aArray[$aX]) / 1000), 592-45, $yTop, 136, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)

    $Label[$aX] = GUICtrlCreateLabel(" " & DriveStatus($aArray[$aX]), 746-45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)

    If GUICtrlGetState($Radios[$aX]) = $GUI_DISABLE Then GUICtrlSetState($Label[$aX], $GUI_DISABLE)

    $iY += 30
    $yTop += 30
Next

GUISetState(@SW_SHOW)


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE

            Exit
    EndSwitch
WEnd


Func _EnableOKButton()
    GUICtrlSetState($ShowDrivesOKButton, $GUI_ENABLE)
EndFunc

Func _Exit()
    Exit
EndFunc

Func _EnableNetworkDrive()
    For $aN = 1 To $Radios[0]
        GUICtrlSetState($Radios[$aN], $GUI_ENABLE)
    Next
EndFunc
Edited by HockeyFan

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

Maybe something like this :

#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <File.au3>

Opt("GUIOnEventMode", 1) ;0=disabled, 1=OnEvent mode enabled

HotKeySet("!n", "_EnableNetworkDrive") ;Alt-n

Global $Path = "C:\Program Files\Program\"
If @OSVersion = "WIN_7" Then
    $Path = "C:\Program Files (x86)\Program\"
EndIf

Local $aArray = DriveGetDrive("ALL") ;Type of drive to find: "ALL", "CDROM", "REMOVABLE", "FIXED", "NETWORK", "RAMDISK", or "UNKNOWN"

If @error Then
    ; An error occurred when retrieving the drives.
    MsgBox(4096, "Error", "A fatal error has occured.")
    Exit
EndIf

Local $sList

Global $Radios[$aArray[0] + 1] = [$aArray[0]] ; [0] = count
Global $Label1[$aArray[0] + 1] = [$aArray[0]], $Label2 = $Label1, $Label3 = $Label1, $Label4 = $Label1, $Label5 = $Label1 ; [0] = count

Global $iX = 42 ; Starting X-pos
Global $iY = 132 ; Starting Y-pos

Global $yTop = 136

$ShowDrivesGUIForm = GUICreate("", 846, 481, -1, -1, 0, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE))
$ShowDrivesGUILabel1 = GUICtrlCreateLabel("Banner", 10, 10, 820, 33, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 16, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel1 = GUICtrlCreateLabel('( Instructions )', 10, 45, 812, 33, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 10, 800, 0, "Arial")
GUICtrlSetColor(-1, 0xFF0000)
$ShowDrivesGroup = GUICtrlCreateGroup("", 10, 80, 825, 281)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
$ShowDrivesLabel2 = GUICtrlCreateLabel("Drive:", 60, 105, 50, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel3 = GUICtrlCreateLabel("Volume Name:", 130, 105, 200, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowdrivesLabel4 = GUICtrlCreateLabel("Drive Type:", 290, 105, 111, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowdrivesLabel5 = GUICtrlCreateLabel("Drive Size (GB):", 419, 105, 115, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDriveLabel6 = GUICtrlCreateLabel("Free Space (GB):", 547, 105, 127, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel7 = GUICtrlCreateLabel("Status:", 701, 105, 111, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$ShowDrivesOKButton = GUICtrlCreateButton("OK", 369, 384, 107, 41)
GUICtrlSetFont(-1, 14, 800, 0, "Arial")
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent($ShowDrivesOKButton, "_Exit")

For $aX = 1 To $Radios[0]
    $Radios[$aX] = GUICtrlCreateRadio(" " & StringUpper($aArray[$aX]), $iX, $iY, 60, 30)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetOnEvent(-1, "_EnableOKButton")

    $Label1[$aX] = GUICtrlCreateLabel(" " & DriveGetLabel($aArray[$aX]), 130, $yTop, 200 - 50, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    If GUICtrlRead(-1) = " " & "" Then GUICtrlSetData(-1, StringUpper(" " & $aArray[$aX]))
    $DriveC = GUICtrlRead($Label1[$aX])
    If $DriveC = " " & "C:" Then GUICtrlSetState($Radios[$aX], $GUI_CHECKED)

    $Label2[$aX] = GUICtrlCreateLabel(" " & DriveGetType($aArray[$aX]), 335 - 45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $DriveType = GUICtrlRead($Label2[$aX])
    If $DriveType = " " & "Network" Then GUICtrlSetState($Radios[$aX], $GUI_DISABLE)
    ;If $DriveType = " " & "Network" Then GUICtrlSetState($Label[$aX], $GUI_DISABLE)

    $Label3[$aX] = GUICtrlCreateLabel(" " & Int(DriveSpaceTotal($aArray[$aX]) / 1000), 464 - 45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)

    $Label4[$aX] = GUICtrlCreateLabel(" " & Int(DriveSpaceFree($aArray[$aX]) / 1000), 592 - 45, $yTop, 136, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)

    $Label5[$aX] = GUICtrlCreateLabel(" " & DriveStatus($aArray[$aX]), 746 - 45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)

    $iY += 30
    $yTop += 30
Next

GUISetState(@SW_SHOW, $ShowDrivesGUIForm)

While 1
    Sleep(10)
WEnd

Func _EnableOKButton()
    GUICtrlSetState($ShowDrivesOKButton, $GUI_ENABLE)

    For $i = 1 To $Radios[0]
        If $Radios[$i] = @GUI_CtrlId Then
            GUICtrlSetState($Label1[$i], $GUI_ENABLE)
            GUICtrlSetState($Label2[$i], $GUI_ENABLE)
            GUICtrlSetState($Label3[$i], $GUI_ENABLE)
            GUICtrlSetState($Label4[$i], $GUI_ENABLE)
            GUICtrlSetState($Label5[$i], $GUI_ENABLE)
        Else
            GUICtrlSetState($Label1[$i], $GUI_DISABLE)
            GUICtrlSetState($Label2[$i], $GUI_DISABLE)
            GUICtrlSetState($Label3[$i], $GUI_DISABLE)
            GUICtrlSetState($Label4[$i], $GUI_DISABLE)
            GUICtrlSetState($Label5[$i], $GUI_DISABLE)
        EndIf
    Next
EndFunc   ;==>_EnableOKButton

Func _Exit()
    Exit
EndFunc   ;==>_Exit

Func _EnableNetworkDrive()
    For $aN = 1 To $Radios[0]
        GUICtrlSetState($Radios[$aN], $GUI_ENABLE)
    Next
EndFunc   ;==>_EnableNetworkDrive
Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

FireFox,

Thanks for you help!  That's pretty close to what I was trying to do except I was wanting to make all labels with an associated disabled radio button also disabled when the GUI is displayed.

Kudos though...as my next thought was to try and disable all labels except the labels associated with the radio button when the radio button is selected. 

Any thoughts on getting the labels associated with Network drives disabled prior to displaying the GUI?

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

FireFox,

Thanks to your idea, I've decided to go another route and have all labels disabled and then enabled based on the radio button selection.

Thank you!!  :thumbsup:

#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <File.au3>

Opt("GUIOnEventMode", 1)  ;0=disabled, 1=OnEvent mode enabled

HotKeySet("!n", "_EnableNetworkDrive")  ;Alt-n

Global $Path = "C:\Program Files\Program\"
If @OSVersion = "WIN_7" Then
    $Path = "C:\Program Files (x86)\Program\"
EndIf

$ShowDrivesGUIForm = GUICreate("", 846, 481, -1, -1, 0, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$ShowDrivesGUILabel1 = GUICtrlCreateLabel("Banner", 10, 10, 820, 33, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 16, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel1 = GUICtrlCreateLabel('( Instructions )', 10, 45, 812, 33, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 10, 800, 0, "Arial")
GUICtrlSetColor(-1, 0xFF0000)
$ShowDrivesGroup = GUICtrlCreateGroup("", 10, 80, 825, 281)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
$ShowDrivesLabel2 = GUICtrlCreateLabel("Drive:", 60, 105, 50, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel3 = GUICtrlCreateLabel("Volume Name:", 130, 105, 200, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowdrivesLabel4 = GUICtrlCreateLabel("Drive Type:", 290, 105, 111, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowdrivesLabel5 = GUICtrlCreateLabel("Drive Size (GB):", 419, 105, 115, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDriveLabel6 = GUICtrlCreateLabel("Free Space (GB):", 547, 105, 127, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
$ShowDrivesLabel7 = GUICtrlCreateLabel("Status:", 701, 105, 111, 22, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$ShowDrivesOKButton = GUICtrlCreateButton("OK", 369, 384, 107, 41)
GUICtrlSetFont(-1, 14, 800, 0, "Arial")
GUICtrlSetState(-1, $GUI_DISABLE)
;GUISetState(@SW_SHOW)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###

GUICtrlSetOnEvent($ShowDrivesOKButton, "_Exit")

Local $aArray = DriveGetDrive("ALL")    ;Type of drive to find: "ALL", "CDROM", "REMOVABLE", "FIXED", "NETWORK", "RAMDISK", or "UNKNOWN"

If @error Then
    ; An error occurred when retrieving the drives.
    MsgBox(4096, "Error", "A fatal error has occured.")
    Exit
EndIf

Local $sList

Global $Radios[$aArray[0] + 1] = [$aArray[0]] ; [0] = count
;Global $Label[$aArray[0] + 1] = [$aArray[0]] ; [0] = count
Global $Label1[$aArray[0] + 1] = [$aArray[0]], $Label2 = $Label1, $Label3 = $Label1, $Label4 = $Label1, $Label5 = $Label1 ; [0] = count

Global $iX = 42 ; Starting X-pos
Global $iY = 132 ; Starting Y-pos

Global $yTop = 136

For $aX = 1 To $Radios[0]
    $Radios[$aX] = GUICtrlCreateRadio(" " & StringUpper($aArray[$aX]), $iX, $iY, 60, 30)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetOnEvent(-1, "_EnableOKButton")
    
    $Label1[$aX] = GUICtrlCreateLabel(" " & DriveGetLabel($aArray[$aX]), 130, $yTop, 200-50, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    If GUICtrlRead(-1) = " " & "" Then GUICtrlSetData(-1, StringUpper(" " & $aArray[$aX]))
    GUICtrlSetState(-1, $GUI_DISABLE)
    $DriveC = GUICtrlRead($Label1[$aX])
    If $DriveC = " " & "C:" Then GUICtrlSetState($Radios[$aX], $GUI_DISABLE)

    $Label2[$aX] = GUICtrlCreateLabel(" " & DriveGetType($aArray[$aX]), 335-45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $DriveType = GUICtrlRead($Label2[$aX])
    If $DriveType = " " & "Network" Then GUICtrlSetState($Radios[$aX], $GUI_DISABLE)
    ;If $DriveType = " " & "Network" Then GUICtrlSetState($Label[$aX], $GUI_DISABLE)

    $Label3[$aX] = GUICtrlCreateLabel(" " & Int(DriveSpaceTotal($aArray[$aX]) / 1000), 464-45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_DISABLE)

    $Label4[$aX] = GUICtrlCreateLabel(" " & Int(DriveSpaceFree($aArray[$aX]) / 1000), 592-45, $yTop, 136, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_DISABLE)

    $Label5[$aX] = GUICtrlCreateLabel(" " & DriveStatus($aArray[$aX]), 746-45, $yTop, 120, 22, $SS_CENTERIMAGE, $WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetState(-1, $GUI_DISABLE)

    ;If GUICtrlGetState($Radios[$aX]) = $GUI_DISABLE Then GUICtrlSetState($Label[$aX], $GUI_DISABLE)

    $iY += 30
    $yTop += 30
Next

GUISetState(@SW_SHOW)


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE

            Exit
    EndSwitch
WEnd


Func _EnableOKButton()
    GUICtrlSetState($ShowDrivesOKButton, $GUI_ENABLE)

    For $i = 1 To $Radios[0]
        If $Radios[$i] = @GUI_CtrlId Then
            GUICtrlSetState($Label1[$i], $GUI_ENABLE)
            GUICtrlSetState($Label2[$i], $GUI_ENABLE)
            GUICtrlSetState($Label3[$i], $GUI_ENABLE)
            GUICtrlSetState($Label4[$i], $GUI_ENABLE)
            GUICtrlSetState($Label5[$i], $GUI_ENABLE)
        Else
            GUICtrlSetState($Label1[$i], $GUI_DISABLE)
            GUICtrlSetState($Label2[$i], $GUI_DISABLE)
            GUICtrlSetState($Label3[$i], $GUI_DISABLE)
            GUICtrlSetState($Label4[$i], $GUI_DISABLE)
            GUICtrlSetState($Label5[$i], $GUI_DISABLE)
        EndIf
    Next
EndFunc

Func _Exit()
    Exit
EndFunc

Func _EnableNetworkDrive()
    For $aN = 1 To $Radios[0]
        GUICtrlSetState($Radios[$aN], $GUI_ENABLE)
    Next
EndFunc

Share this post


Link to post
Share on other sites

I knew you wanted to have only one line enabled at start, but I prefer you to learn from yourself and this is what you've done :)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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