Results 1 to 15 of 15

Thread: Outlook Express control?

  1. #1

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Outlook Express control?

    Is there a single control that is used in Outlook Express and other MS apps, that acts like a multi-column listbox? With the little grey tabs at the top you can resize individual columns?

    In OE, it is the email list section I am talking about...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    GridEx2000 expencive but great.
    -= a peet post =-

  3. #3
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    Why not use a Listview. It should give you pretty much the same effect.

  4. #4

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Can u give me a brief run down of what methods/properties I should look at to get started? I haven't used that control before...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  5. #5
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    Add a listview to a form (common controls) and a coomand button.
    Change the style property of the listview to 'LvwReport'

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3. Dim Item As ListItem
    4.  
    5. ListView1.ColumnHeaders.Add , , "Column1"
    6. ListView1.ColumnHeaders.Add , , "Column2"
    7. ListView1.ColumnHeaders.Add , , "Column3"
    8.  
    9. Set Item = ListView1.ListItems.Add(, , "Data1")
    10. Item.SubItems(1) = "Subitems11"
    11. Item.SubItems(2) = "Subitems12"
    12.  
    13. Set Item = ListView1.ListItems.Add(, , "Data2")
    14. Item.SubItems(1) = "Subitems21"
    15. Item.SubItems(2) = "Subitems22"
    16.  
    17. Set Item = ListView1.ListItems.Add(, , "Data3")
    18. Item.SubItems(1) = "Subitems31"
    19. Item.SubItems(2) = "Subitems32"
    20.  
    21. End Sub
    22.  
    23. ' I normally just loop through the recordset adding the fields etc to the listview ( cut and paste example from one of my projects.)
    24. It also adjusts the width of the column depending on the length of the longest entry.
    25.  
    26. ' Setup ListItems
    27.     For I = 1 To NV.RecordCount
    28.         ListText = NV.FieldItem(1)
    29.         Set Item = Main.ListView1.ListItems.Add(, "mvk" & NV.FieldItem(0), ListText)
    30.        
    31.         If Main.TextWidth(ListText) > ColWidth(1) Then
    32.             ColWidth(1) = Main.TextWidth(ListText) + 200
    33.         End If
    34.        
    35.         For J = 2 To FieldCount
    36.             ListText = NV.FieldItem(J)
    37.             Item.SubItems(J - 1) = ListText
    38.             If Main.TextWidth(ListText) > ColWidth(J) Then
    39.                 ColWidth(J) = Main.TextWidth(ListText) + 200
    40.             End If
    41.         Next J
    42.         NV.MoveNext
    43.     Next I

    Ends up looking like the attached.
    Hope it helps
    Attached Images Attached Images  

  6. #6

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Ooo - sexy. I like it. Cheers Pickler.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  7. #7

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Is there any way to lose the blank column at the right?
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  8. #8
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    Just adjust the width of your columns ( all or just the last one ).
    Of course only if the total width of all columns is less than the width of the listview control.


    Cheers
    (pizza and vodka time)

  9. #9

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Thought as much - that was what I've been doing.

    Awesome... now, back to your pizza and vodka!
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  10. #10
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    Yes.. well one must have their prorites...
    I mean prioties...
    Maybe priortrees....
    Sh*t, I mean another vodka....

  11. #11
    Fanatic Member skald2k's Avatar
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    535
    rjo: You have almost 2000 posts and you have never used the listview control before? =]
    - If at first you dont succeed, then give up, cause you will never will!

  12. #12
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by skald2k
    rjo: You have almost 2000 posts and you have never used the listview control before? =]
    not everyone uses all the controls in VB... i didn't use them for a long time because when i went to a vb class they only showed us flex grids... so eventually I moved all my apps over to listviews... i didn't even know what to call them. i just knew they were the list box that napster used

  13. #13

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Originally posted by skald2k
    rjo: You have almost 2000 posts and you have never used the listview control before? =]
    Nope...
    Never had a need to. I don't think it matters though - I can pick up the usage of a control pretty easily and quickly, so it's never gonna be a great trauma for me to use another control.
    What I do lack though, is foresight as to what controls there are that may serve my purpose. Since I'd never used the listview control before, I didn't kow it was there, and consequently, I was using a crappy method to solve my problem... but ... I got betta....
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  14. #14
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    i have learned more on this board than i have from all my vb books...

  15. #15

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Originally posted by kleinma
    i have learned more on this board than i have from all my vb books...
    As have I...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width