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

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

The problem here is knowing the width of the client area of the ListView
control. This is the total width less the width of the vertical scroll bars
and borders.

There should be a message you could send to the ListView window to know
that, but I simply subtract 1 (one) inch from the controls width and allways
get a "reasonably" good display. Check the attached form.

On Form_Load a ListView control is initialized with 3 columns "File", "Date"
and "Size", then it is populated with the contents of the "c:\windows\"
directory.

On Form_Resize the ListView is resized so that it fills the form, and the
the first Column ("File") is resized.

Alejandro.

Pigeon escribi en mensaje ...

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.



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

Pigeon skrev i meddelandet ...

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.

in pseudo:
columnheader.width=(listview.width-borders)/  columnheaders.count
M V H
Kai Sevelin

begin 666 Kai Sevelin.vcf
M0D5'24XZ5D-!4D0-"DXZ4V5V96QI;CM+86D-"D9..DMA:2!3979E;&EN#0I/
M4D<Z5&AI;FM486YK#0I4251,13I-86YA9V5R#0I!1%([2$]-13H[.SL[.SM3
M=V5D96X-"DQ!0D5,.TA/344Z4W=E9&5N#0I%34%)3#M04D5&.TE.5$523D54
M.FYS96MA0&]S:V%R<VAA;6XN;6%I;"YT96QI82YC;VT-"D5.1#I60T%21 T*
`
end



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

Quote:
> Check the attached form.

    Hmm... attached form ??

Pigeon.



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

Dear Pigeon,

Here it is, sorry.

If you open it directly from Outlook, ignore the error messages, add the
Microsoft Common Controls to the toolbox and then replace the picturebox
with a ListView.
Hope it helps.

Alejandro.

Pigeon escribi en mensaje

Quote:
>> Check the attached form.

>    Hmm... attached form ??

>Pigeon.

  Form1.frm
2K Download


Tue, 04 Jul 2000 03:00:00 GMT  
 
 [ 6 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