home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "Sorting Sample"
- ClientHeight = 4185
- ClientLeft = 3465
- ClientTop = 2670
- ClientWidth = 6135
- Height = 4635
- Left = 3405
- LinkTopic = "Form1"
- ScaleHeight = 4185
- ScaleWidth = 6135
- Top = 2280
- Width = 6255
- Begin DataList.GTList GTList1
- Height = 3495
- Left = 360
- TabIndex = 0
- Top = 240
- Width = 5295
- _Version = 65536
- DefColCaptionBorderStyle= 3
- BeginProperty DefColCaptionFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BeginProperty DefFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BeginProperty ScrollTipFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BeginProperty ExtendTipFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LImgs.Count = 1
- _ExtentX = 9340
- _ExtentY = 6165
- _StockProps = 81
- BackColor = -2147483643
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Form_Load()
- 'First we want to define three columns
- 'The first two arguments in each of these
- 'method calls are left blank. We do not
- 'want to specify a index or key
- 'The key properties will be initialized to
- 'an empty string and the indexs will be
- 'initialized to the next availible index
- 'This being 0, 1, and 2 in this case
- GTList1.ColumnDefs.Add , , "First Name"
- GTList1.ColumnDefs.Add , , "Last Name"
- GTList1.ColumnDefs.Add , , "Age"
- 'Next we need to add some items to the list
- 'This is done by populating the ListItem
- 'collection. The key and indexs are once
- 'again left blank. The text specified for
- 'the listitem object goes into column 0.
- GTList1.ListItems.Add , , "Joe"
- GTList1.ListItems.Add , , "Jane"
- GTList1.ListItems.Add , , "Ed"
- 'Now we have a list of three items each with
- 'only the first column populated. To add data
- 'to the second and third column (column 1 and 2
- 'respectively), we must fill the subitem.text
- 'properties as follows
- 'This fills the second column for each item
- GTList1.ListItems(0).SubItems(1).Text = "Shmoe"
- GTList1.ListItems(1).SubItems(1).Text = "Doe"
- GTList1.ListItems(2).SubItems(1).Text = "Johnson"
- 'This fills the third column for each item
- GTList1.ListItems(0).SubItems(2).Text = "29"
- GTList1.ListItems(1).SubItems(2).Text = "33"
- GTList1.ListItems(2).SubItems(2).Text = "16"
- End Sub
-