Link to home
Start Free TrialLog in
Avatar of broesi
broesi

asked on

Urgent question: Listview with checkboxes / column width

Hi Experts,

I have a listview with checkboxes and one additional column holding text information. The column for the checkboxes is too small, the checkboxes appear too close to the text.

Is it possible to make the checkbox-column wider?

broesi
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

ListView1.ColumnHeader(1).Width=300    
Clicked submit button to soon.

You can adjust column width in FormLoad event.  Change 300 to whatever seems to work for you.  

ListView1.ColumnHeader(2).Width=?  would set width of the second column and so fort.

Mike
Avatar of broesi
broesi

ASKER

Hm,

the listview only has one column, and that contains the text data!?

Here's the code used to populate the list:

Private Sub Form_Load()
    Dim rs As ADODB.Recordset
    Dim li As ListItem
   
     Set rs = gDB.getRecordset("select MyText from tblMyTable"
   
    lv.ColumnHeaders.Add , , "Text", 5000
   
    Do While Not rs.EOF
        Set li = lv.ListItems.Add()
        li.Text = rs(0)
        rs.MoveNext
    Loop
End Sub

When I set a breakpoint at th do while... lv.columnheaders.count is 1


broesi
SOLUTION
Avatar of Shauli
Shauli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi broesi,

All I know about List View, I have learned from Shauli.  I am greatfull we have an expert like Shauli at EE.  His response is more complete and to the point.  

Regards,

Mike
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of broesi

ASKER

Thanks a lot, guys! I've split the point, because I used Noel's suggestion and Shauli gave a good explanation of what's actually going on - is that okay with you?

broesi
Im glad that you use that simple idea. the split was ok with me. actually, that is my 1st points earned here. but by just knowing that the code helps you makes me feel good. im happy. tnx. :)