Results 1 to 2 of 2

Thread: ListView Save settings

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Proctor,Vt USA
    Posts
    47

    Post

    With a multi columned listview shown as a listreport is there a way to save the size of the columns, (after the user as adjusted them to their liking) to the registry so when the program is reopened they won't have to set them again? Thanks in advance

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    Sure, here's an example:

    Private Const DEFAULT_WIDTH = 500 'or whatever you prefer

    Private Sub Form_Load()
    Dim iCount%, i%
    With ListView1
    iCount = .ColumnHeaders.Count
    For i = 1 To iCount
    .ColumnHeaders(i).Width = GetSetting("YourAppName", "SectionName", "Column" & i, DEFAULT_WIDTH)
    Next
    End With
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    Dim iCount%, i%
    With ListView1
    iCount = .ColumnHeaders.Count
    For i = 1 To iCount
    SaveSetting "YourAppName", "SectionName", "Column" & i, .ColumnHeaders(i).Width
    Next
    End With
    End Sub

    Good luck!

    ------------------
    Joacim Andersson
    [email protected]
    [email protected]
    www.YellowBlazer.com



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width