Android Question How do you make a label/button invisible inside scrollview?

Josh Christie

New Member
Licensed User
So I've got a scrollview with a couple buttons inside.
The test button when clicked, will pop up with a msgbox2. Depending on the answer of that msgbox (in this case, positive), I would like the SellBottle button to go invisible.

SellBottle.Visible = False doesn't seem to work.

Sub fillScrollView
Dim inventorypanel As Panel
inventorypanel = ScrollView1.Panel

If Store.BottleCount > 0 Then

SellBottle.Initialize("SellBottle")
inventorypanel.AddView(SellBottle,0,0,95%x,150)
SellBottle.Text = "Bottles of Oil: " & Store.BottleCount
SellBottle.TextSize = 12
SellBottle.Gravity = Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL)

End If

testbutton.Initialize("testbutton")
inventorypanel.AddView(testbutton,0,160,95%x,150)
testbutton.Text = "test button"
testbutton.Gravity = Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL)

End Sub

Sub testbutton_Click
testbuttonresult = Msgbox2("test","test","positive","","Negative",Null)
If testbuttonresult = DialogResponse.POSITIVE Then
SellBottle.Visible = False


End If
End Sub

Any help with this would be greatly appreciated! Thanks
 

Josh Christie

New Member
Licensed User
Thanks, I figured out what was wrong, I had it being initialized in both onCreate and onResume, so it was not behaving correctly there.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…