Sign in to follow this  
Followers 0
Norsestar

button func's

2 posts in this topic

having trouble setting a button to load up information in the display boxes on my script...

i have the buttons set already, but i haven't had any luck creating a function to make them read/write information that i've input into the input box. for example: i type $5.00 into the deposit input box and click ok. when i click ok, i want it to add $5.00 to the total amount and then display the resulting amount in the display box. and same for withdrawals, except to subtract $5.00

would also like to be able to have it write the information for different accounts and load said account upon selection. i.e. when i select "current" and click Load, i want it to load the information for the "current" account and save information to that one without overwriting other accounts and to be able to load the other account whenever i choose.

my intentions are far more advanced than my knowledge it appears lol. i'm also looking to have a user create/login box to load up separate user accounts with their account information and have them be able to add/delete accounts from their list as well without interfering with different user's accounts, etc...

attached is a baseline script that just gets the gui open, but no functions unfortunately

Manage_Your_Finances___Beta.zip


Education: Francis Tuttle Technology Center adult full-time studentCourse of study: Network TechnologyCurrent Course: Microsoft Windows Server 2003, Enterprise EditionCompleted Courses: CompTIA A+ Hardware and Software, Windows XP Professional, Microsoft Office 2003, Desktop Support and Troubleshooting, and CompTIA Network+Remaining Courses: Linux Administration, Copper Cabling, Microsoft Windows Server 2003, Enterprise EditionAchievements: @17 years old, scored 98th percentile U.S. in Algebra 2 and Advanced Chemistry. [i.e. Ranked top 2% in the nation of High School students]

Share this post


Link to post
Share on other sites



Look at GUICtrlRead(), GUICtrlSetData()

Here is concept:

#include <GUIConstants.au3>
#include <GUITab.au3>
#include <Date.au3>

Global $sum = 0

GUICreate("Manage Your Finances - Beta")  ; will create a dialog box that when displayed is centered
GUISetBkColor(0x00000000)

GUISetState (@SW_SHOW)       ; will display an empty dialog box
;create the tabs
$tab = GUICtrlCreateTab(10, 10, 200, 125, BitOR($TCS_FLATBUTTONS, $TCS_MULTILINE), $TCS_EX_FLATSEPARATORS)
;view deposits, pending and completed
$tab0 = GUICtrlCreateTabItem("Deposits")
GUICtrlCreateLabel("Amount", 90, 80, 50, 20)
$tab0OK = GUICtrlCreateButton("OK", 20, 60, 50, 20)
$tab0input = GUICtrlCreateInput("$0.00", 80, 60, 70, 20)
GUICtrlCreateTabItem("") ; end tabitem definition
;view withdrawals, pending and completed
$tab1 = GUICtrlCreateTabItem("Withdrawals")
GUICtrlCreateLabel("Amount", 30, 80, 50, 20)
$tab1input = guictrlcreateinput("$0.00", 20, 60, 70, 20)

$tab1OK = GUICtrlCreateButton("OK", 100, 60, 50, 20)
GUICtrlCreateTabItem("") ; end tabitem definition
;current balance
$tab2 = GUICtrlCreateTabItem("Balance")
GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
GUICtrlCreateLabel("Estimated Balance as of" & _Nowdate(), 30, 65, 100, 30)
GUICtrlCreateTabItem("") ; end tabitem definition
;view pending transactions
$tab3 = GUICtrlCreateTabItem("Transactions")
guictrlcreatebutton("List...", 30, 60, 45, 20)
guictrlcreatelabel("Pending Transactions as of" & _Nowdate() & " " & _nowtime(), 100, 60, 100, 50)
GUICtrlCreateTabItem("") ; end tabitem definition
;select an account
$tab4 = GUICtrlCreateTabItem("Accounts")
$tab1combo = GUICtrlCreateCombo("", 20, 60, 175, 40)
GUICtrlSetData(-1, "Current|Theoretical Future", "Current") ; default Jon
$tab4OK = guictrlcreatebutton("Load", 85, 95, 45, 20)
GUICtrlCreateTabItem("") ; end tabitem definition

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
   Select
       Case $msg = $GUI_EVENT_CLOSE
         Exit
      Case $msg = $tab1OK   
         $vakue = GUICtrlRead($tab1input))
         $sum = $sum - $vakue
         MsgBox(0,"WithDraw", $vakue)
         MsgBox(0,"Sum", $sum)
   EndSelect
WEnd

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