Is there a way to avoid the following little issue ..
In my app I use a button to delete local items. As a precaution I employ the use of the LongClick() event (to avoid accidental clicks)
Once all items are deleted I disable the button
The problem is, the button remains in its "pressed-down" look
Try this simple example:
Is there a method to avoid this situation? I tried various combinations of the following inside the LongClick() sub:
In my app I use a button to delete local items. As a precaution I employ the use of the LongClick() event (to avoid accidental clicks)
Once all items are deleted I disable the button
The problem is, the button remains in its "pressed-down" look
Try this simple example:
B4X:
' Button stuck in "Pressed Down" look from LongClick/Disable combo
Sub Process_Globals
End Sub
Sub Globals
Dim bt As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
bt.Initialize("ButtonPress") : bt.Text="Long-Press me"
Activity.AddView(bt,10%x,20dip,60%x,40dip)
End Sub
Sub ButtonPress_LongClick()
bt.Enabled=False
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Is there a method to avoid this situation? I tried various combinations of the following inside the LongClick() sub:
bt.Invalidate
bt.Visible=True .... False
DoEvents