Hi,
I can't work out why this is not working and hoping someone can work it out..
First of all I am loading a layout which has 3 labels and 6 buttons in it.
What I am trying to do is adjust the label value as you press on the buttons.
When the Activity loads the default values are:
Hours = 0
Mins = 0
pmam = "AM"
I am using the following code to adjust the values..
Problem I have is when I press the buttons to adjust the value it's changing it to 0.1, 0.2 etc.
(hours, mins, pmam are all labels that are created with the designer script and loaded to the Activity from the Activity_Create Sub)
Any ideas on what I am doing wrong ?
I can't work out why this is not working and hoping someone can work it out..
First of all I am loading a layout which has 3 labels and 6 buttons in it.
What I am trying to do is adjust the label value as you press on the buttons.
When the Activity loads the default values are:
Hours = 0
Mins = 0
pmam = "AM"
I am using the following code to adjust the values..
B4X:
Sub hour_up_Click
If hours.Text = 23 Then Return
hours.Text = hours.Text + 1
End Sub
Sub hour_down_Click
If hours.Text = 1 Then Return
hours.Text = hours.Text - 1
End Sub
Sub mins_up_Click
If mins.Text = 59 Then Return
mins.Text = mins.Text + 1
End Sub
Sub mins_down_Click
If mins.Text = 0 Then Return
mins.Text = mins.Text - 1
End Sub
Sub ampm_up_Click
If pmam.Text = "PM" Then Return
pmam.Text = "PM"
hours.Text = hours.Text + 12
End Sub
Sub ampm_down_Click
If pmam.Text = "AM" Then Return
pmam.Text = "AM"
hours.Text = hours.Text - 12
End Sub
Problem I have is when I press the buttons to adjust the value it's changing it to 0.1, 0.2 etc.
(hours, mins, pmam are all labels that are created with the designer script and loaded to the Activity from the Activity_Create Sub)
Any ideas on what I am doing wrong ?