I'm currently working on a form that will have a scrolling list of records but each record can have different types of information. I plan on creating panels on the fly, one panel per record; filling them with labels, which may even be multiline; then using the ControlsEx scrollbar to adjust the .top of each panel (as well as .height and .show/.hide) to simulate a scrolling list.
The problem I'm having is that I need to be able to click anywhere on these panels to select one record which will then go to another form for editing that record. My initial ideas were to create a button over each panel set to transparent so that the underlying labels would show, or to make the labels disabled and use the click event of the underlying panel to detect a click. Neither of these seem work. Lastly, I thought of trying to detect a generic click and comparing the x/y positions with the bounds of all the displayed panels but I can't find a way to do this either.
Failing these options, I could change every label into a button and hook the click event of every button and the underlying panel into the same function but this seems a bit of overkill for what I'm trying to do. Anyone have any other ideas?
This is for use on a PPC running WM6.
Thanks in advance.
The problem I'm having is that I need to be able to click anywhere on these panels to select one record which will then go to another form for editing that record. My initial ideas were to create a button over each panel set to transparent so that the underlying labels would show, or to make the labels disabled and use the click event of the underlying panel to detect a click. Neither of these seem work. Lastly, I thought of trying to detect a generic click and comparing the x/y positions with the bounds of all the displayed panels but I can't find a way to do this either.
Failing these options, I could change every label into a button and hook the click event of every button and the underlying panel into the same function but this seems a bit of overkill for what I'm trying to do. Anyone have any other ideas?
This is for use on a PPC running WM6.
Thanks in advance.