Hi,
As the title suggests, I'm using VB.NET 2008, and I've got a problem with a disappearing horizontal scrollbar on a ListBox where I'm using the DrawItem event. DrawItem is set to OwnerDrawFixed.
I think I know WHY I'm not seeing the scrollbar, but I can't figure out how to fix it. I may have to use a DataGridView, but I'd prefer to understand the solution to the ListBox problem.
What I think is happening is this line is filling my rectangle with my brush to the boundary of the rectangle:
The line is filling the rectangle with my data:Code:e.Graphics.FillRectangle(myBrush, e.Bounds)
I've seen that I can reduce e.Bounds.Width, and each line is cut short. Naturally, I'd have thought that if I increase e.Bounds.Width, the item line would be longer than the visible rectangle width.Code:e.Graphics.DrawString(Me.lstReportContent.Items(e.Index), e.Font, myBrush, New RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height))




Reply With Quote