Ksmith,
I have added a quick example of what you want, actually putting the increase and decrease into the button click event for each button would be quicker (margret explained this) but if you create the buttons and then change
event name of both buttons to the same text (in this example '
PriceChange') and then set the
tag in both to two different strings (this can be numbers or text or a mixture), then the new event name is call each time the button is pressed and the event sub will look at the tag of the sending view (button in this example) and then carry out different actions depending on the tag.
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim PriceLabel As Label
Dim PriceIncreasebtn As Button
Dim PriceDecreasebtn As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("main")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub PriceChange_Click
Dim btn As Button, price As Int
btn = Sender
price = PriceLabel.Text
If btn.Tag ="Increase" Then
price = price + 1
Else
price = price - 1
End If
PriceLabel.Text = price
End Sub
I hope it helps.
Stu