0

I made a customlistview in b4a but I can not fix the click event.

I want when button clicks image to pause and other buttons image to play when click image button is changed but other button image not change.

enter image description here

my code load

Sub load
For i = 0 To cur.RowCount-1
cur.Position=i
Dim p As Panel
play.Text = Chr(0xE037)
p.Initialize("p")
sco.Panel.AddView(p,1%x,top,98%x,500dip)
p.LoadLayout("layload")
play.Tag = cur.GetInt("id")
play.Typeface = awf
text.Text = cur.GetString("text")
top = top + 60dip + 2%x
Next
sco.Panel.Height = top + 10dip
End Sub

and code play

Sub play_Click
tim.Enabled = True
Dim lml As Label
lml.Initialize("lml")
lml = Sender
Dim curbv As Cursor
curbv = sql.ExecQuery("SELECT * FROM tab1 ")
curbv.Position = lml.Tag - 1
sec = curbv.Position
meda.Load(File.DirAssets,curbv.GetString("mp"))
kl(lml)
End Sub

and my code for change icon

Sub kl( ln As Label) 
If ln.Text = Chr(0xE037) Then
ln.Text = Chr(0xE047)
meda.Play
load
Else If ln.Text = Chr(0xE047) Then
ln.Text = Chr(0xE037)
meda.Stop
End If
Sleep(100)
play.Text = Chr(0xE037)
End Sub
  • Welcome to SO. When asking questions, your English isn't expected to be perfect, but you can make your question a lot easier to read by using punctuation. At a minimum, use periods and question marks at the ends of sentences. https://stackoverflow.com/help/how-to-ask – LarsH Mar 11 '19 at 16:33
  • You may show us some code, otherwise we can't tell you what you're doing wrong, and where to put the correction to your problem. – vincrichaud Mar 11 '19 at 16:56

0 Answers0