Jump to content

add and subtract


 Share

Recommended Posts

hi this simple add and subtract showing on status bar but im stuck on one thing all working fine like i want it . but subtract method ends on 0 i want this simply ends on 1 .

can any one tell me where is problem try this script and let me know soultion

#include <GUIConstants.au3>
#Include <GuiStatusBar.au3>
Local $gui
Local $a_PartsText[3]
Local $a_PartsRightEdge[3] = [200, 500, -1]

$add = 1


$gui = GUICreate("Database Gui", 800,600)  
$StatusBar1 = _GUICtrlStatusBarCreate ($gui, $a_PartsRightEdge, $a_PartsText)
$next =  GUICtrlCreateButton ("add",  100, 500,100) 
$prv =   GUICtrlCreateButton ("subtract",  300, 500,100) 

GUISetState (@SW_SHOW)  



While 1
    
$msg = GUIGetMsg()

    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $next
             $add = 1 + $add
             call("_next") 
         Case $msg = $prv
             $add = $add - 1 
             if $add = -1  then
                $add = 1
                 EndIf
             call("_prv")


    EndSelect


Wend

func _prv()
    _GUICtrlStatusBarSetText($StatusBar1,$add)
EndFunc
func _next()
    _GUICtrlStatusBarSetText($StatusBar1,$add)
EndFunc
Edited by autoitxp
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...