I’ve been trying to get my app better organized using Container Controls.
Ran into a little problem so I created an example trying to isolate the issue.
I have this listbox. In the Open Event I have this code. Works fine, populating the headers.
Then I create a Container Control. Cut the Listbox out of the main Window and paste it into the Container control. Looks good. The Open Event code (above) was copied as expected. Then place the Container, (with the listbox) onto the Main Window. But now when I run the app, the headers don’t show up. I believe the app is executing the Open Event because I hear the beep at the end. But no headers. Any idea why this is not working?
I tried putting the above header code in the Open Event of the Container, (with full references instead of using me prefix) but that didn’t work either. I even place the code in a button. Still, the beep goes off but the header don’t not get populated.
I went ahead and populated the headings from the IDE Inspector. That worked.
But still the CompareRows event for numeric sorting no longer works.
Though… the ListBox.AlignRight in the Open Event did catch.
I installed Xojo2018r3. Had the same problem. Thought the reversion conversion might carry over the problem, so I just created the same sample project from scratch. No change.
I guess I’ll just wait for another Windows user to try it out. Seems everyone is running Macs.
I would say you’ve found a bug. The header is there (taking up space) but isn’t drawn. If you set the inspector property hasheader to on everything else works just fine.
Thanks everyone for chipping in on this. Something new users should always consider.
This is one of the best things about Xojo! The community!! What a pleasure.
Posting a message and getting answers so quickly.
I will download the Feedback app and post this as a bug. Done.
Less than 24 hours after reporting this bug, I got these messages:
[quote]User “William Yu” has updated case #54689.
»»Status changed from ‘Verified’ to ‘Fixed’.
»»Report closed. This case was not ranked
[/quote]
[quote]The following comments were left:
As a temporary workaround, you can add this bit of code in your ContainerControl Open event
to force the Listbox headers to appear (they are actually hidden which was the bug):[/quote]