D DickD Active Member Licensed User Jun 16, 2017 #1 I have created a layout with buttons named B1, B2, B3 etc. All of them have the save event name BTest. Each has a different tag. I have created a subroutine BTest_click. Shouldn't clicking any of these buttons launch that subroutine? They don't. Nothing happens. Can this work? B4X: Dim B1, B2, B3 as button ... Sub BTest_click (tag as string) log("Button pushed: " & tag) End sub
I have created a layout with buttons named B1, B2, B3 etc. All of them have the save event name BTest. Each has a different tag. I have created a subroutine BTest_click. Shouldn't clicking any of these buttons launch that subroutine? They don't. Nothing happens. Can this work? B4X: Dim B1, B2, B3 as button ... Sub BTest_click (tag as string) log("Button pushed: " & tag) End sub
klaus Expert Licensed User Longtime User Jun 16, 2017 #2 You don't need: Dim B1, B2, B3 As Button And then: B4X: Sub BTest_Click Private btn As Button btn = Sender Log("Button pushed: " & btn.Tag) End sub Upvote 0
You don't need: Dim B1, B2, B3 As Button And then: B4X: Sub BTest_Click Private btn As Button btn = Sender Log("Button pushed: " & btn.Tag) End sub
D DickD Active Member Licensed User Jun 16, 2017 #3 klaus said: You don't need: Dim B1, B2, B3 As Button And then: B4X: Sub BTest_Click Private btn As Button btn = Sender Log("Button pushed: " & btn.Tag) End sub Click to expand... That works. Thanks. Upvote 0
klaus said: You don't need: Dim B1, B2, B3 As Button And then: B4X: Sub BTest_Click Private btn As Button btn = Sender Log("Button pushed: " & btn.Tag) End sub Click to expand... That works. Thanks.