Solved

ListView resize

Posted on 2004-10-24
1,482 Views
Last Modified: 2008-02-20
Greetings,

I have a listview control in Form1. I'd like to resize the listview (thus occupying the entire form in the left and right). Do I have to set the listview1.width and height in form_resize event?

Secondly, the listview does not occupy the entire form, and giving a ugly look in high resolution displays (leaving a white space in either side of the form).

thanks!
0
Question by:sramesh2k
    3 Comments
     
    LVL 5

    Accepted Solution

    by:
    Try this-

    Option Explicit

    Private Sub Form_Load()
        Call ResizeListView
    End Sub

    Private Sub ResizeListView()
        With ListView1
            .Top = 0
            .Left = 0
            .Width = Me.Width
            .Height = Me.Height
        End With
    End Sub

    Private Sub Form_Resize()
        Call ResizeListView
        DoEvents
    End Sub

    Thx
    0
     
    LVL 34

    Author Comment

    by:sramesh2k
    Thanks, KarcOrigin!
    0
     
    LVL 34

    Author Comment

    by:sramesh2k
    FYI:A slight alteration I did, as required:

    --------------
    If Me.WindowState <> vbMinimized Then
            ListView1.Left = 0
            ListView1.Top = Toolbar1.Height
            ListView1.Width = Me.ScaleWidth
            ListView1.Height = Me.ScaleHeight - Toolbar1.Height - StatusBar1.Height
    End If
    ---------------
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Prepare to Pass the CompTIA A+ 900 Series Exam

    CompTIA aims to adapt its A+ Certification to reflect the most current knowledge and skills needed by today's IT professionals--and this year's 2016 exam is harder than ever. This certification is one of the most highly-respected and sought after in IT.

    Suggested Solutions

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    875 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

    12 Experts available now in Live!

    Get 1:1 Help Now