Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ListView resize

Posted on 2004-10-24
3
Medium Priority
?
1,488 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
Comment
Question by:sramesh2k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
KarcOrigin earned 500 total points
ID: 12397094
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
ID: 12397414
Thanks, KarcOrigin!
0
 
LVL 34

Author Comment

by:sramesh2k
ID: 12397421
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

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 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