I have some SwiftButtons in some items of CustomListView and want to handle the Sender only in one Sub. This works only, if I have an empty line in the SwiftButtons _Click events. Why?
Sender is empty, when no empty line:
Sub SetNotenOption(mode As Int)
Dim sbtn As SwiftButton = Sender 'is null, if the _Click event will not have an empty code-line
Dim iIndex As Int = sbtn.Tag' find CLV-index via .Tag, because .GetItemFromView works not with SwiftButton, only B4Xview! clvMusicList.GetItemFromView(Sender) 'Sender von SwiftButton 1-4
Dim t As BookItemType = clvMusicList.GetValue(iIndex)
Main.cG.i_MusicMode = mode
Select mode
Case 4, 5
SetNoten(t, False)
Case 6
Case 7
End Select
End Sub
Private Sub SwiftButton1_Click
'why we need an empty line here???
SetNotenOption(5) 'Begleitung FrmMusic.i_MOD_BEGL
End Sub
Private Sub SwiftButton2_Click
SetNotenOption(4) 'Kontrolle
End Sub
Private Sub SwiftButton3_Click 'will not work, because first line in the Sub has to be empty
SetNotenOption(6) 'Game
End Sub
Private Sub SwiftButton4_Click
SetNotenOption(7) 'Info
End Sub