Jump to content

Recommended Posts

Posted

:think: How can make Hide button, When I click Login button logout appear and login button Hide opasite way.

Thanks for any help.

This is my script

#include <GuiConstants.au3> 

$Main_GUI = GUICreate("Example", 400, 300, 100, 100)
$B_oIE2 = ObjCreate("Shell.Explorer.2")
$browser = GUICtrlCreateObj($B_oIE2, 10, 100, 380, 150)  
$BotBStart = GUICtrlCreateButton("&Logout", 80, 60, 60, 25)
GUICtrlSetState( -1, $GUI_HIDE); hide the button
$BotStart = GUICtrlCreateButton("&Login", 80, 30, 60, 25)
$BrkEnd = GUICtrlCreateButton("&Exit", 200, 50, 80, 25)
GUISetState() 

While 1 
    
    $msg = GUIGetMsg() 
    
    If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then 
        Exit
    EndIf
    
    If $msg = $BotStart Then    
        $B_oIE2.navigate ("www.autoitscript.com")
        GUICtrlSetState( $BotBStart, $GUI_SHOW); Hide the button.
        
    ElseIf $msg = $BotBStart Then 
        $B_oIE2.navigate ("www.autoitscript.com/forum")
        GUICtrlSetState( $BotBStart, $GUI_HIDE); show the button.
     
    
    EndIf
WEnd


            
        

        

        
    

    
    

    

                    
                    
                        
                            


     (adsbygoogle = window.adsbygoogle || []).push({});

                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


Norky
            
            
                Posted 
                
            
        
    
    
        


Norky
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 38
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            
#include <GuiConstants.au3> $Main_GUI = GUICreate("Example", 400, 300, 100, 100)$B_oIE2 = ObjCreate("Shell.Explorer.2")$browser = GUICtrlCreateObj($B_oIE2, 10, 100, 380, 150)  $BotBStart = GUICtrlCreateButton("&Logout", 80, 60, 60, 25)GUICtrlSetState( -1, $GUI_HIDE); hide the button$BotStart = GUICtrlCreateButton("&Login", 80, 30, 60, 25)$BrkEnd = GUICtrlCreateButton("&Exit", 200, 50, 80, 25)GUISetState() While 1         $msg = GUIGetMsg()         If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then         Exit    EndIf        If $msg = $BotStart Then             $B_oIE2.navigate ("www.autoitscript.com")        GUICtrlSetState( $BotBStart, $GUI_SHOW); Hide the button.            ElseIf $msg = $BotBStart Then         $B_oIE2.navigate ("www.autoitscript.com/forum")        GUICtrlSetState( $BotBStart, $GUI_HIDE); show the button.             EndIfWEndHeeeeeeeeelp please  


            
        

        

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


Thatsgreat2345
            
            
                Posted 
                
            
        
    
    
        


Thatsgreat2345
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 2.5k
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            this should work
#include <GuiConstants.au3>

$Main_GUI = GUICreate("Example", 400, 300, 100, 100)
$B_oIE2 = ObjCreate("Shell.Explorer.2")
$browser = GUICtrlCreateObj($B_oIE2, 10, 100, 380, 150)
$BotBStart = GUICtrlCreateButton("&Logout", 80, 60, 60, 25)
GUICtrlSetState(-1, $GUI_HIDE); hide the button
$BotStart = GUICtrlCreateButton("&Login", 80, 30, 60, 25)
$BrkEnd = GUICtrlCreateButton("&Exit", 200, 50, 80, 25)
GUISetState()

Do
$msg = GUIGetMsg()
Select

Case $msg = $BotStart 
$B_oIE2.navigate ("www.autoitscript.com")
If guictrlgetstate($BotBStart) = 96 Then
GUICtrlSetState($BotBStart, $GUI_SHOW)
Guictrlsetstate($BotStart, $GUI_Hide)
EndIf

Case $msg = $BotBStart 
$B_oIE2.navigate ("www.autoitscript.com/forum")
If guictrlgetstate($BotBStart) = 80 Then
GUICtrlSetState($BotBStart, $GUI_Hide)
Guictrlsetstate($BotStart,$GUI_SHOW)
EndIf
EndSelect
Until $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd

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
  • Recently Browsing   0 members

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