A couple Listview Questions (eVB / API) 
Author Message
 A couple Listview Questions (eVB / API)

I've got three Listview questions that I'd love to have answered.

1) Is it possible to be able to select the entire line (each row) of a
listview? It is a real pain only being able to select the text of the first
column.

2) Can you lock the column width of a particular column so that some columns
can be resized and others can't? I can think of one way to do this, but it
would require a column resize event.

3) Is there any advantage to using the API listview rather than the eVB
control? Is there more functionality? Do I use less installation space?

Thanks in advance...
--
Derek Perkins
General Manager
Pocket Innovations (www.pocket-innovations.com)
Powerful applications for a portable world



Wed, 20 Aug 2003 22:04:40 GMT  
 A couple Listview Questions (eVB / API)
Hi Derek,
courtesy of Brad Martinez, and ported from VB6

Inilistview sets the listview to full row select
lvautosize sizes the list view optimally depending on the contents of the
header or the listitems, whichever
is the greatest

Enjoy

Pete

Declare Function SendMessage Lib "Coredll" Alias "SendMessageW" (ByVal hwnd
As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As
Long
Const LVS_EX_FULLROWSELECT = &H20
Const LVM_FIRST = &H1000
Const LVM_GETEXTENDEDLISTVIEWSTYLE = &H1037
Const LVM_SETEXTENDEDLISTVIEWSTYLE = &H1036
Const LVM_SETCOLUMNWIDTH = &H101E

Public Sub IniListView(myList As ListViewCtrl)

    myList.SetFocus
    lret = SendMessage(GetFocus(), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
    lret = lret Or LVS_EX_FULLROWSELECT
    Call SendMessage(GetFocus(), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, lret)

End Sub

Public Sub lvAutosize(lv As ListViewCtrl) '
    lv.SetFocus
    Dim col2adjust As Long

    For col2adjust = 0 To lv.ColumnHeaders.Count - 1

      Call SendMessage(GetFocus(), _
                       LVM_SETCOLUMNWIDTH, _
                       col2adjust, _
                        -2)
    Next
End Sub



Quote:
> I've got three Listview questions that I'd love to have answered.

> 1) Is it possible to be able to select the entire line (each row) of a
> listview? It is a real pain only being able to select the text of the
first
> column.

> 2) Can you lock the column width of a particular column so that some
columns
> can be resized and others can't? I can think of one way to do this, but it
> would require a column resize event.

> 3) Is there any advantage to using the API listview rather than the eVB
> control? Is there more functionality? Do I use less installation space?

> Thanks in advance...
> --
> Derek Perkins
> General Manager
> Pocket Innovations (www.pocket-innovations.com)
> Powerful applications for a portable world



Wed, 20 Aug 2003 22:54:50 GMT  
 A couple Listview Questions (eVB / API)
forgot to include:-

Declare Function GetFocus Lib "Coredll" () As Long

Pete



Quote:
> I've got three Listview questions that I'd love to have answered.

> 1) Is it possible to be able to select the entire line (each row) of a
> listview? It is a real pain only being able to select the text of the
first
> column.

> 2) Can you lock the column width of a particular column so that some
columns
> can be resized and others can't? I can think of one way to do this, but it
> would require a column resize event.

> 3) Is there any advantage to using the API listview rather than the eVB
> control? Is there more functionality? Do I use less installation space?

> Thanks in advance...
> --
> Derek Perkins
> General Manager
> Pocket Innovations (www.pocket-innovations.com)
> Powerful applications for a portable world



Fri, 22 Aug 2003 20:35:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. couple questions about Listview, scrolling, and editing strings

2. A couple (ok, well maybe a little more than a couple) of (beginner) questions

3. A couple questions, API

4. eVb sucks -is there no API in eVB???

5. API/eVB/PC Pro Questions

6. ListView API question

7. ListView API question

8. Listview API Question

9. New to automation - a couple questions - MS Word 97

10. I got a couple of questions....Please read

11. A couple of questions

12. Couple of UserForm Questions

 

 
Powered by phpBB® Forum Software