Sign in to follow this  
Followers 0
eri

Checkbox and bad script.. Help me again M23..

4 posts in this topic

I have create combo show all and removable drive when checkbox = checked will show all drive..

But when checkbox = checked my processor up to 98% (frezz)

This is..

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Local $msg, $Checkbox1, $var

Example()

Func Example()
    GUICreate("My GUI combo")
    $Checkbox1 = GUICtrlCreateCheckbox("See All", 10, 10, 97, 17)
    GUICtrlCreateCombo("", 30, 30)
    GUISetState()

    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
        $var = DriveGetDrive( "all" ) ;< i want when show all drive, removable drive will be disable
            Getdrive()
        Else
        $var = DriveGetDrive( "Removable" ) ;<i want when show removable drive, all drive will be disable
            Getdrive()
        EndIf
    WEnd
EndFunc

Func Getdrive()
    If NOT @error Then
        For $i = 1 to $var[0]
            GUICtrlSetData(-1, $var[$i])
        Next
    EndIf
EndFunc

please help me..

Add and modive sample script from help file..

Thank you..

Share this post


Link to post
Share on other sites



Something like this?

#include <GUIConstantsEx.au3>
$1=0
GUICreate("My GUI combo")
$Checkbox1 = GUICtrlCreateCheckbox("See All", 10, 10, 97, 17)
$c1 = GUICtrlCreateCombo("", 30, 30)
$c2 = GUICtrlCreateCombo("", 30, 30)
$var = DriveGetDrive( "all" )
If NOT @error Then
    For $i = 1 to $var[0]
        GUICtrlSetData($c1, $var[$i])
    Next
EndIf
$var = DriveGetDrive( "Removable" )
If NOT @error Then
    For $i = 1 to $var[0]
        GUICtrlSetData($c2, $var[$i])
    Next
EndIf
GUICtrlSetState($c1, $GUI_HIDE)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case GUICtrlRead($Checkbox1) = $GUI_CHECKED And $1 = 0
            GUICtrlSetState($c1, $GUI_SHOW)
            GUICtrlSetState($c2, $GUI_HIDE)
            $1 = 1
        Case GUICtrlRead($Checkbox1) <> $GUI_CHECKED And $1 = 1
            GUICtrlSetState($c2, $GUI_SHOW)
            GUICtrlSetState($c1, $GUI_HIDE)
            $1 = 0
    EndSelect
WEnd

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

eri,

Please stop adding my name to your post titles. :(

As you can see from bogQ's excellent reply above, there are lots of people here to help you. :)

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

eri,

Please stop adding my name to your post titles. :(

As you can see from bogQ's excellent reply above, there are lots of people here to help you. :)

M23

@ bogQ thank you..

@ M23.. I`m sorry.. I will not do it again.. :)

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