ListBox: is this a bug ?

I was able to reproduce the issue :

Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) As Boolean If row Mod 2 = 0 and column < me.ColumnCount Then g.ForeColor = &cf3f6fA g.FillRect(0, 0, g.Width, g.Height) End If End Function

My test listbox has 3 columns widths : 100,20,300 but the width of the listbox itself is 526.

If I stop painting at the normally maximum columns 2, I get the white area. If I remove the test

column < me.ColumnCount

the non existent column 3 is painted and the listbox is painted across.

I insist : column 3 does not exist, yet it is painted when you do not test.

Watch carefully Albin’s moovie: the demonstation is there and it have nothing related to how I or someone draw the ListBox background because he used the default background colour.

I falled into that bug because I wanted to be sure to see Horizontal Scroll Bar *. I do not searched a bug or anything else.

  • I had troubles doing so years ago (or was it last year ?) even with Dave S. help !
    One more thank you Dave.

LBN: it behave the same with a 2013r3 compiled application.

Back at home, I will check with older StandAlone… and report if I found older.

It’s real difficult to assist you sometimes…

You are apparently NOT using the default background. You must be drawing the background to get cyan and light yellow rows. Can you please post your code in CellBackgroundPaint ?

My code (not handly) is a simple variation of yours / the one in the docs: I use two colors instead of one.

What no one understand except Albin who simply does not add a colored background and get that white column.

THE WHITE COLUMN HAVE NOTHING RELATED TO BACKGROUN?D COLORING (so you get it without code in CellBackgroundPaint).

In another project (I do not checked it, yet), I use a three colors background (a magenta background flags a special Row (different from the others) while the 2 colors background are here only for reading purposes (youc an better follow the Row (when reading it).

The question was: is this a bug. It never was “How do I get rid of that white Column”. Even I have troubles to make that white column appears, but it appears.

[quote=128822:@Emile Schwarz]My code (not handly) is a simple variation of yours / the one in the docs: I use two colors instead of one.

What no one understand except Albin who simply does not add a colored background and get that white column.

THE WHITE COLUMN HAVE NOTHING RELATED TO BACKGROUN?D COLORING (so you get it without code in CellBackgroundPaint).

In another project (I do not checked it, yet), I use a three colors background (a magenta background flags a special Row (different from the others) while the 2 colors background are here only for reading purposes (youc an better follow the Row (when reading it).

The question was: is this a bug. It never was “How do I get rid of that white Column”. Even I have troubles to make that white column appears, but it appears.[/quote]

Then the only thing you MUST do is to file a bug report with a sample project demonstrating the problem attached. This discussion should have been ended a long time ago.

I’ve created a sample project Emile. If it demonstrates what you are seeing you may use it to create a feedback case. I cannot do that from here.
https://app.box.com/s/kt548633l23gi75qh399

PS. If there is no coloring done in CellBackgroundPaint this issue will not show itself.

[quote=128826:@Albin Kiland]I’ve created a sample project Emile. If it demonstrates what you are seeing you may use it to create a feedback case. I cannot do that from here.
https://app.box.com/s/kt548633l23gi75qh399

PS. If there is no coloring done in CellBackgroundPaint this issue will not show itself.[/quote]

I downloaded it and ran the project on the IDE on Windows 7… Definitely a bug!

Speaking of bug I found an IDE listbox bug when looking at that project…

At home I’m on a 27"iMac so I rarely have to scroll the Window in the layout editor… Now I’m on a laptop,… and when I scroll the Widow editor in the IDE the window with the listbox scrolls, but NOT the listbox contents! Never noticed that before!!! (but I rarely use listbox.Initial value for anything but headers)

  • Karen

[quote=128826:@Albin Kiland]I’ve created a sample project Emile. If it demonstrates what you are seeing you may use it to create a feedback case. I cannot do that from here.
https://app.box.com/s/kt548633l23gi75qh399

PS. If there is no coloring done in CellBackgroundPaint this issue will not show itself.[/quote]

Thank you Albin for posting that project. Now I understand what is going on. In effect, the third column is the non existent column with no set width, and resizing it seems to make the Listbox view narrower than the control. If only instead of turning around the pot Emile had been kind enough to post a sample as you do, we would not have wasted so much time trying to understand his awfully confused thinking.

I doubt Emile may post any bug report, so I have done it for you :
<https://xojo.com/issue/35336>

No problem. I’m glad to help where I can.
And thank you for creating the fb case :slight_smile:

[quote=128893:@Albin Kiland]No problem. I’m glad to help where I can.
And thank you for creating the fb case :)[/quote]

You are welcome. I believe the only way to help the community is to contribute with bug reports to give a chance to Xojo, Inc. to correct them.

In the meantime, I just found a simple workaround. That is another way to help the community.

  • Add a timer to the page
  • In its action event :

Sub Action() Listbox1.visible = false Listbox1.visible = true me.enabled = false End Sub

in the listbox MouseDown event :

if me.HasHeading = true then if y <= me.HeaderHeight then Timer1.mode = Timer.ModeSingle Timer1.Enabled = True end if end if

ListBox.Invalidate does not work, but making it invisible and back forces the redraw and the white area disappears. I used a timer because it is the simplest way, but one could monitor instead the system.mousedown and system.mouseup and do that upon mouseup if x moves left.

The bug is also on Windows (XP):

Also, if you add a color to the window in Albin sample project, (check the image below), you can watch the bug.

To get that, I only clicked in the Background color property and choose a red. I saved the whole screen, so you can see the IDE in the background and know what change I’ve made.

Oh, I forgot:

to display the bug on Windows, I only had to shrink the last column. It was strangely so easy to do !

[quote=128985:@Emile Schwarz]Oh, I forgot:

to display the bug on Windows, I only had to shrink the last column. It was strangely so easy to do ![/quote]

Why don’t you add all this information to <https://xojo.com/issue/35336> and eventually upload the modified project as well over there so it has a chance to be fixed ? The forum posts will get lost, so if you really want to help the community, try to make an effort.

So you cannot imagine the amount of time I spent for this bug ?
Just to make a way to reproduce it, then “wait” until someone confirm I found something (that is not so usual).

I am not a tester, but a user.

When ? Remember, the old forum is still available.

One Click to display the color selection window, another click to choose a color and at last one clik to apply the color + a Run command ?

I have wasted too many hours, days, … and I do not have time anymore for that. At last, my english is too bad.

Thank you for creating the bug report.

[quote=128989:@Emile Schwarz]So you cannot imagine the amount of time I spent for this bug ?
Just to make a way to reproduce it, then “wait” until someone confirm I found something (that is not so usual).

I am not a tester, but a user.[/quote]

Don’t give me user versus tester. I am just another user, but I do try to help. And don’t talk about time. It took me about 3 minutes to file the bug report.

Fortunately, unlike you who seem to enjoy dragging things, Albin posted a project that explained the bug. If you had done that with your first post, we would not have had to painfully try to follow your convoluted and half baked explanations for 30 posts.

The fact that you do not perfectly master English does not explain or excuse in any way that obvious desire not to explain anything clearly. Besides, the channel “Français” would allow you to write in French if you really wanted to communicate.