ListBox DrawItem Horizontal scrollbar
-
Hello, As the title suggests, 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'm using VB.NET 2008 Express. 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:
e.Graphics.FillRectangle(myBrush, e.Bounds)
The line is filling the rectangle with my data: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))
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. -
Hello, As the title suggests, 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'm using VB.NET 2008 Express. 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:
e.Graphics.FillRectangle(myBrush, e.Bounds)
The line is filling the rectangle with my data: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))
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.Have you solved this?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer