ListView control

I am using a ListView Control.  When I add more items than the ListView can display a Horizontal and Vertical scrollbar is displayed which is a bit Naff.  I only really want a Vertical one displayed.  Does anyone know a solution other than FlatScrollBar???
I_jollyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

caraf_gCommented:
Adjust the width of your column headers when the number of list items * the height of the list items exceeds the height of the list view.
0
caraf_gCommented:
Try the following as an example: For more than one column you may want to modify only the last column's width, or all columns.... it's up to you. Don't take the values I entered as Gospel either, I found them by trial and error:

Option Explicit

Private Sub Command1_Click()

Dim intColumnHeaderHeight As Integer
Dim intLVBorderWidth As Integer
Dim intVerticalScrollBarWidth As Integer

intColumnHeaderHeight = 14 * Screen.TwipsPerPixelY
intLVBorderWidth = 6 * Screen.TwipsPerPixelX
intVerticalScrollBarWidth = 16 * Screen.TwipsPerPixelX

With ListView1
    .ListItems.Add , , "test"

    If .ListItems(1).Height * .ListItems.Count > .Height - intColumnHeaderHeight Then
        .ColumnHeaders(1).Width = .Width - intLVBorderWidth - intVerticalScrollBarWidth
    Else
        .ColumnHeaders(1).Width = .Width - intLVBorderWidth
    End If
End With

End Sub

Private Sub Form_Load()

Dim intLVBorderWidth As Integer

intLVBorderWidth = 6 * Screen.TwipsPerPixelX

With ListView1
    .ColumnHeaders.Add , , "hi", .Width - intLVBorderWidth
    .LabelEdit = lvwManual
    .View = lvwReport
End With

End Sub
0
I_jollyAuthor Commented:
Hi caraf_g,
This is a good answer and is very similar to what I am doing now.  I will re-open the question though just to see if there is another, more compact, method of doing this as this was what I was looking for.  If there isn't I will award you the points.  
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

caraf_gCommented:
Thanks, hope you'll get a better answer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I_jollyAuthor Commented:
Thanks for the help.
0
caraf_gCommented:
Sorry you didn't get a better answer. Thanks for the points!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.