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...
Printable View
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...
GridEx2000 expencive but great. :)
Why not use a Listview. It should give you pretty much the same effect.:)
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...
Add a listview to a form (common controls) and a coomand button.
Change the style property of the listview to 'LvwReport'
VB Code:
Private Sub Command1_Click() Dim Item As ListItem ListView1.ColumnHeaders.Add , , "Column1" ListView1.ColumnHeaders.Add , , "Column2" ListView1.ColumnHeaders.Add , , "Column3" Set Item = ListView1.ListItems.Add(, , "Data1") Item.SubItems(1) = "Subitems11" Item.SubItems(2) = "Subitems12" Set Item = ListView1.ListItems.Add(, , "Data2") Item.SubItems(1) = "Subitems21" Item.SubItems(2) = "Subitems22" Set Item = ListView1.ListItems.Add(, , "Data3") Item.SubItems(1) = "Subitems31" Item.SubItems(2) = "Subitems32" End Sub ' I normally just loop through the recordset adding the fields etc to the listview ( cut and paste example from one of my projects.) It also adjusts the width of the column depending on the length of the longest entry. ' Setup ListItems For I = 1 To NV.RecordCount ListText = NV.FieldItem(1) Set Item = Main.ListView1.ListItems.Add(, "mvk" & NV.FieldItem(0), ListText) If Main.TextWidth(ListText) > ColWidth(1) Then ColWidth(1) = Main.TextWidth(ListText) + 200 End If For J = 2 To FieldCount ListText = NV.FieldItem(J) Item.SubItems(J - 1) = ListText If Main.TextWidth(ListText) > ColWidth(J) Then ColWidth(J) = Main.TextWidth(ListText) + 200 End If Next J NV.MoveNext Next I
Ends up looking like the attached.
Hope it helps:)
Ooo - sexy. I like it. Cheers Pickler. :D
Is there any way to lose the blank column at the right?
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)
Thought as much - that was what I've been doing.
Awesome... now, back to your pizza and vodka!
:p
Yes.. well one must have their prorites...
I mean prioties...
Maybe priortrees....
Sh*t, I mean another vodka....:p
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 :D :DQuote:
Originally posted by skald2k
rjo: You have almost 2000 posts and you have never used the listview control before? =]
Nope... :pQuote:
Originally posted by skald2k
rjo: You have almost 2000 posts and you have never used the listview control before? =]
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.... :p
i have learned more on this board than i have from all my vb books...
As have I... :pQuote:
Originally posted by kleinma
i have learned more on this board than i have from all my vb books...