Total width of columns = Width of ListView 
Author Message
 Total width of columns = Width of ListView

Dear all,

    How should I resize columns of a ListView, so that the total width of
all columns will be equal to the width of the ListView control ?

    Thanks...

Pigeon.



Fri, 30 Jun 2000 03:00:00 GMT  
 Total width of columns = Width of ListView

The code below sorta works works for making fixed width columns...

There is some extra space, which may be an issue with the control size
metrics of other rocket science.

Hope it help for a start :)

[quick and dirty example code]

Private Sub Form_Load()
    'Quick and dirty test code
    Dim lvwColHead As ColumnHeader
    Dim sngColWidth As Single

    sngColWidth = ListView1.Width / ListView1.ColumnHeaders.Count
    With ListView1
        For Each lvwColHead In .ColumnHeaders
            lvwColHead.Width = sngColWidth
        Next
    End With
End Sub

[end of quick and dirty example]

Quote:

>Dear all,

>    How should I resize columns of a ListView, so that the total width of
>all columns will be equal to the width of the ListView control ?

>    Thanks...

>Pigeon.



Fri, 30 Jun 2000 03:00:00 GMT  
 Total width of columns = Width of ListView

Quote:
>    sngColWidth = ListView1.Width / ListView1.ColumnHeaders.Count

    That means all the width of the columns will be equal, right ?

    Can I go something like those column resizing in Outlook 97 ?

    In Outlook 97, when you choose one column for auto resizing, other
columns will be resized also, so that the total width of all columns will be
equal to the width of the ListView...

    But in ListView, I've found that the total width of all columns in a
ListView is always larger than the width of the ListView... this confused
me...

    Anyone got any idea ? Thanks a lot.

Pigeon.



Sat, 01 Jul 2000 03:00:00 GMT  
 Total width of columns = Width of ListView


Fri, 19 Jun 1992 00:00:00 GMT  
 Total width of columns = Width of ListView

Hi,
I'm using the wang image controls (imgScan, imgEd, imgAdmin, etc.) to
interface to a TWAIN scanner.

Problem:  I can't seem to get it to scan more than one image (page) to a
file in one scanning session.  I.e., I can scan 4 pages into a file, but
only the 1st page shows up.
Also, the pagecompleted event does not file.

Any ideas?  I'd like a sanity check that this is NOT expected behavior.

BTW, I'm using it with a Logitech Pagescan Color parallel scanner.
Slick little gadget for $100.

-Clay Nichols



Mon, 03 Jul 2000 03:00:00 GMT  
 Total width of columns = Width of ListView


Fri, 19 Jun 1992 00:00:00 GMT  
 Total width of columns = Width of ListView

Hi, I used this code...

Sub theSize()
    If Me.ScaleHeight > tbrContact.Height + stbClient.Height Then
        With lstClient
            .Top = tbrContact.Height
            .Left = 0
            .Height = Me.ScaleHeight - tbrContact.Height - stbClient.Height
            .Width = Me.ScaleWidth
        End With
        lstClient.ColumnHeaders.Item(1).Width = (lstClient.Width / 4) - 375
        lstClient.ColumnHeaders.Item(2).Width = (lstClient.Width / 4) - 375
        lstClient.ColumnHeaders.Item(3).Width = (lstClient.Width / 4) - 375
        lstClient.ColumnHeaders.Item(4).Width = (lstClient.Width / 4) - 375
    End If
End Sub

I used the 375 to leave space for a vertical scroll bar. It really works
fine.

===================================
Carlos Amaya

CTO
AmayaSoft, Inc.
El Salvador, C.A.

Quote:

> Dear all,

>     How should I resize columns of a ListView, so that the total width of
> all columns will be equal to the width of the ListView control ?

>     Thanks...

> Pigeon.



Tue, 04 Jul 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Total width of columns = Width of ListView

2. Total width of columns = Width of ListView

3. Total width of columns = Width of ListView

4. ListView column width = ListView width ?

5. Setting datagrid column width sets width of toplevel!!

6. Set Grid width to sum of Column Widths

7. Make dbgrid columns width follow form width ???

8. ListView.Width <> Sum of ColumnHeader widths

9. Total listview width

10. Preserving column widths in Listview

11. How to get the widths of the columns in a ListView

12. How to get control if you resize the width of a Column in a ListView

 

 
Powered by phpBB® Forum Software