How do resize listview colums widths programatically in compact framework?

Posted on 2014-08-22
Last Modified: 2014-09-12
I have a listview called lvPoints. I know how to set the thing up prior to data being added but once the data has been added how do I resize each column programmatically?

I found an article that says to use the AutoResizeColumn property but that is not supported in my version of compact framework. The target device is a Win Mobile 6.5 pro.

Question by:PBLack

    Author Comment

    VB.Net 2008 is being used.
    LVL 83

    Accepted Solution

    According to the [MSDN page] on column widths:

    This property enables you to set the Width of the ColumnHeader. The ColumnHeader can be set to adjust at run time to the column contents or heading. To adjust the width of the longest item in the column, set the Width property to -1. To autosize to the width of the column heading, set the Width property to -2

    For your purposes you should be setting the column width to -1. Note that you will have to do this after adding the items to the list.

    Author Closing Comment


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now