ListBox in Container Anomaly

  1. 4 weeks ago

    paul t

    Jan 17 Seattle, WA

    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.

    Me.HasHeading=True
    Me.ColumnsResizable = True
    Me.textsize =12
    Me.ColumnCount =10
    Me.ColumnWidths="10%,10%,10%,10%,10%,10%,10%,10%,10%,10%"
    Me.Heading(0)="One"
    Me.Heading(1)="Two"
    Me.Heading(2)="Three"
    Me.Heading(3)="Four"
    Me.Heading(4)="Five"
    Me.Heading(5)="Six"
    Me.Heading(6)="Seven"
    Me.Heading(7)="Eight"
    Me.Heading(8)="Nine"
    Me.Heading(9)="Ten"
    Beep

    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 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.

  2. Alberto D

    Jan 17 Pre-Release Testers, Xojo Pro

    Xojo version?
    Mac, Win, Linux?

    Using Xojo2018r3 on macOS 10.12.6, small test with that code and it works.

  3. Markus W

    Jan 17 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...

    Using Xojo2018r3 on macOS 10.14.2, works here too.

    Suggest you delete the listbox and drag a new one to the ContainerControl.

  4. Markus W

    Jan 17 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...

    You could also populate the header in the IDE instead of in the open event.

  5. paul t

    Jan 17 Seattle, WA
    Edited 4 weeks ago

    I'm using Xojo2018r4 on Windows 10.

    I did try deleting the listbox and replacing it with a new on on the Container Control.

    Here's a link to the sample app where I've isolated the problem:
    https://drive.google.com/open?id=13Op9Fsa2MOS4xu6dct8V23arDld2puxX

    Good idea Markus! I'll just populate the headings from the IDE Inspector

  6. Edited 4 weeks ago

    I tried your test project on Mojave with Xojo 2018r3 & it works. Just guessing but it might be a Xojo bug with the Windows version?

  7. paul t

    Jan 17 Seattle, WA
    Edited 4 weeks ago

    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.

  8. Wayne G

    Jan 17 Pre-Release Testers, Xojo Pro Answer New Zealand axisdirect.nz

    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.

  9. Markus W

    Jan 17 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...

    Have you emptied your cache? Sometimes Xojo gets into a weird state …

  10. paul t

    Jan 17 Seattle, WA
    Edited 4 weeks ago

    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.

  11. paul t

    Jan 18 Seattle, WA
    Edited 4 weeks ago

    Less than 24 hours after reporting this bug, I got these messages:

    User "William Yu" has updated case #54689.
    »»Status changed from 'Verified' to 'Fixed'.
    »»Report closed. This case was not ranked

    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):

    Me.Visible = False
    Me.Visible = True
  12. Alberto D

    Jan 18 Pre-Release Testers, Xojo Pro

    Good it was an easy fix and there is a workaround.
    William is great.

or Sign Up to reply!