Eugenio Member Licensed User Longtime User Jan 7, 2012 #1 Hello I need a little help on ScrollView I created a ScrollView and added a button on it, now how I add an event to this button? For example? Msgbox ("Hello", "") when I click on it. Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("frmProjeto11") Button1.Initialize("button") Button1.Text = "Button A" ScrollView1.Panel.AddView(Button1, 10, 40, 100, 80) End Sub Sub Button1_Click Msgbox("test1", "") End Sub thank you
Hello I need a little help on ScrollView I created a ScrollView and added a button on it, now how I add an event to this button? For example? Msgbox ("Hello", "") when I click on it. Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("frmProjeto11") Button1.Initialize("button") Button1.Text = "Button A" ScrollView1.Panel.AddView(Button1, 10, 40, 100, 80) End Sub Sub Button1_Click Msgbox("test1", "") End Sub thank you
NJDude Expert Licensed User Longtime User Jan 7, 2012 #2 The event name has to match the view: B4X: Button1.Initialize("button1") Upvote 0
M mrazamerchant Member Licensed User Longtime User Jan 27, 2014 #4 What if I need to call Msgbox(button1.tag,"test") inside button1_Click. It gives compile error. Upvote 0
DonManfred Expert Licensed User Longtime User Jan 27, 2014 #5 When you got an error it would be a good idea to POST THE ERROR-LOG HERE! Upvote 0