I have created a scrollview in the designer and then in code I add check box views:
B4X:
Dim chkbx As CheckBox
chkbx.initialize("chkbx")
chkbx.text = "checkbox"
ScrollView1.panel.addview(chkbx, 0dip, 0dip, 100dip, 100dip)
...
sub chkbx_Click
Dim x as checkbox
x = sender
''''at this point sender is null
The click event fires but SENDER is null.
Any ideas of what causes this?
Rusty
my mistake, in my post, i typed it instead of copying it from code.
My code has chkbx_checkedChange(checked as boolean)
and Sender is NULL when the checkedchange event fires...don't understand why...
I took out all breakpoints and the Sender NULL issue disappeared...argh!
Thanks for the help
Are you adding only one or more Checkboxes?
If you add more than one you must Dim and Initialize each Checkbox!
It would have been easier to help if you had posted the whole code that adds the Checkboxes.
Thanks all,
in my post #3, i edited it and indicated that the NULL issue was due to having a debug breakpoint.
Once removed, the NULL issue of Sender went away.
I appreciate the responses
And yes, I create many checkboxes in code and I do dimension each one...I got caught on that one several years ago (thanks)
Rusty