Jump to content

Gui Enabled Input Box


lyledg
 Share

Recommended Posts

Guys..

Still learning heaps so apologies for the dumbass question..

I am trying to enable a input box, (which is intially set disabled) through a checkbox..

Basically, If a user chooses the checkbox, the input box should get enabled to accept text..

I know this is simple enough, just been coding all day and not seeing the answer right now...

Cheers! :)

Link to comment
Share on other sites

Guys..

Still learning heaps so apologies for the dumbass question..

I am trying to enable a input box, (which is intially set  disabled) through a checkbox..

Basically, If a user chooses the checkbox, the input box should get enabled to accept text..

I know this is simple enough, just been coding all day and not seeing the answer right now...

Cheers!  :)

<{POST_SNAPBACK}>

GUICtrlSetState($id,$GUI_ENABLE) :)
Link to comment
Share on other sites

Thanks, i have already done this, but still not working..

Here is my code this far:

Global $LOGFILLOC = GUICtrlCreateInput ("", 30, 195 , 300, 20) GUICtrlSetState(-1,$GUI_ACCEPTFILES)GUICtrlSetState(-1,$GUI_DISABLE)$LOG = GUICtrlCreateCheckbox ("/LOG :: Output status to LOG file (overwrite existing log)", 25, 400, 300, 20)While 1  $msg = GUIGetMsg()    If GUIRead($LOG) = $GUI_CHECKED Then           GUICtrlSetState ($LOGFILLOC, $GUI_ENABLED)        Else    EndIf        EndIf[code=auto:0]When using this, I get an error saying I have not defined $LOGFILLOC as a variable. But I have declared this as a Global variable already, what am I doing wrong?CheersSee attachment


            
                


    Edited  by lyledg
    
    

            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


SlimShady
            
            
                Posted 
                
            
        
    
    
        


SlimShady
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 2.3k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
AutoIt lover
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                    (edited)
                
                
            
        
    

    

    

    
        
        
            This should work:
#include <GUIConstants.au3>

Global $LOGFILLOC = GUICtrlCreateInput ("", 30, 195 , 300, 20) 
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
GUICtrlSetState(-1,$GUI_DISABLE)

$LOG = GUICtrlCreateCheckbox ("/LOG :: Output status to LOG file (overwrite existing log)", 25, 400, 300, 20)

While 1
$msg = GUIGetMsg()

If GUIRead($LOG) = $GUI_CHECKED Then
GUICtrlSetState ($LOGFILLOC, $GUI_ENABLE)
Else
EndIf

EndIf
Edited by SlimShady
Link to comment
Share on other sites

Thanks, i have already done this, but still not working..

Here is my code this far:

Global $LOGFILLOC = GUICtrlCreateInput ("", 30, 195 , 300, 20) GUICtrlSetState(-1,$GUI_ACCEPTFILES)GUICtrlSetState(-1,$GUI_DISABLE)$LOG = GUICtrlCreateCheckbox ("/LOG :: Output status to LOG file (overwrite existing log)", 25, 400, 300, 20)While 1  $msg = GUIGetMsg()    If GUIRead($LOG) = $GUI_CHECKED Then           GUICtrlSetState ($LOGFILLOC, $GUI_ENABLED)        Else    EndIf        EndIf[code=auto:0]When using this, I get an error saying I have not defined $LOGFILLOC as a variable. But I have declared this as a Global variable already, what am I doing wrong?CheersSee attachment[post="43275"]<{POST_SNAPBACK}>[/post]the error come from $GUI_ENABLED and not from $LOGFILLOCthe state variable is $GUI_ENABLE 


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


lyledg
            
            
                Posted 
                
            
        
    
    
        


lyledg
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 287
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            Mate

So is the code I am using correct or not? I am a little confused by your answer..

Cheers


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


MHz
            
            
                Posted 
                
            
        
    
    
        


MHz
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                MVPs
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 5.6k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        30
                                
                                    
                                
                            
                        
                    
                
            
            
                

    
    
        
Just simple
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            
I am a little confused by your answer..As SlimShady has done. He has inserted at the top of his rewrite of your script.#include <GUIConstants.au3>
You need to have this in Gui scripts. It contains this
$GUI_ENABLE
This was causing problems. And as jpm described with
$GUI_ENABLED
should be
$GUI_ENABLE
Hope this clears your thoughts on your code.

My advise. lose the else and the extra endif. And add Wend to close the While loop

#include <GUIConstants.au3>

Global $LOGFILLOC = GUICtrlCreateInput ("", 30, 195 , 300, 20) 
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
GUICtrlSetState(-1,$GUI_DISABLE)

$LOG = GUICtrlCreateCheckbox ("/LOG :: Output status to LOG file (overwrite existing log)", 25, 400, 300, 20)

While 1
$msg = GUIGetMsg()

If GUIRead($LOG) = $GUI_CHECKED Then
GUICtrlSetState ($LOGFILLOC, $GUI_ENABLE)
EndIf
Wend

Good luck.

:)

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...