Re: Auto size column listview

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "frank_lupo" <frank_lupo(at)email(dot)it>, "pgadmin-hackers" <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Auto size column listview
Date: 2003-02-10 11:30:15
Message-ID: 03AF4E498C591348A42FC93DEA9661B8259C1A@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks Frank. I've committed a change that uses this code for the 2
listviews on frmMain, and the SQL data grid.

Regards, Dave.

> -----Original Message-----
> From: frank_lupo [mailto:frank_lupo(at)email(dot)it]
> Sent: 10 February 2003 11:06
> To: pgadmin-hackers
> Subject: [pgadmin-hackers] Auto size column listview
>
>
> Public Declare Function SendMessage Lib "user32" Alias
> "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal
> wParam As Long, lParam As Any) As Long
>
>
>
> Public Const LVM_FIRST As Long = &H1000
>
> Public Const LVM_SETCOLUMNWIDTH As Long = (LVM_FIRST + 30)
>
> Public Const LVSCW_AUTOSIZE As Long = -1
>
> Public Const LVSCW_AUTOSIZE_USEHEADER As Long = -2 'Note: On
> last column, its width fills remaining width
>
> 'of list-view
> according to Micro$oft. This does not
>
> 'appear to be the
> case when I do it.
>
>
>
>
>
> 'Auto Size Column
>
> Public Sub AutoSizeColumnLv(lv As ListView)
>
> Dim ii As Integer
>
> Dim szKey As String
>
> Dim objItem As ListItem
>
>
>
> With lv
>
> szKey = CStr(Now)
>
> 'frank_lupo add new element title in listview
>
> Set objItem = .ListItems.Add(1, szKey,
> .ColumnHeaders(1).Text & " ")
>
>
>
>
> SendMessage .hWnd, LVM_SETCOLUMNWIDTH, 0, LVSCW_AUTOSIZE
>
> For ii = 1 To .ColumnHeaders.Count - 1
>
> objItem.SubItems(ii) = .ColumnHeaders(ii + 1).Text & " "
>
> SendMessage .hWnd, LVM_SETCOLUMNWIDTH, ii, LVSCW_AUTOSIZE
>
> Next
>
> 'frank_lupo drop element title in listview
>
> .ListItems.Remove szKey
>
> End With
>
> End Sub
>
>
>
> Bye !!
> Frank Lupo (Wolf) !!
>
> /\_ _/\
> \ o o /
> --ooo-----ooo---
>
>
>
>
>
> --
> Prendi GRATIS l'email universale che... risparmia:
http://www.email.it/f

Sponsor:
Tariffe promozionali per viaggiare in tutto il mondo, clicca e scopri
dove prenotare Clicca qui:
http://adv.email.it/cgi-bin/foclick.cgi?mid=1258&d=10-2

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2003-02-10 11:36:10 Re: fix bug alter database/user set (7.3.1)
Previous Message frank_lupo 2003-02-10 11:05:47 Auto size column listview