Results 1 to 3 of 3

Thread: auto readjust listview ?

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    auto readjust listview ?

    If i have a listview inside of a sizable form and change the size of the form, how do i get the listview to change size accordingly ?

  2. #2
    Junior Member
    Join Date
    Nov 2003
    Posts
    21
    Code:
    private sub form_resize()
    'list1 and form1 being name
    list1.width = form1.width - 400
    list1.height = form1.height - 500
    end sub
    you can play around with that

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    When ever a form is resized, the Form_Resize event fires. Place code to resize the Listview in that event.

    The following example will keep the Listview control the size of the Form.

    VB Code:
    1. Private Sub Form_Resize()
    2.     'don't resize anything if the form is minimized
    3.     If Me.WindowState <> vbMinimized Then
    4.         Me.ListView1.Move 0,0,ScaleWidth,ScaleHeight
    5.     End If
    6. End Sub

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