home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / listbox / mlist46 / demo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-04  |  28.0 KB  |  879 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Multi-Column Demo"
  5.    ClientHeight    =   4410
  6.    ClientLeft      =   450
  7.    ClientTop       =   1800
  8.    ClientWidth     =   8595
  9.    FontBold        =   0   'False
  10.    FontItalic      =   -1  'True
  11.    FontName        =   "MS Sans Serif"
  12.    FontSize        =   12
  13.    FontStrikethru  =   0   'False
  14.    FontUnderline   =   0   'False
  15.    Height          =   5100
  16.    Left            =   390
  17.    LinkTopic       =   "Form1"
  18.    ScaleHeight     =   4410
  19.    ScaleWidth      =   8595
  20.    Top             =   1170
  21.    Width           =   8715
  22.    Begin CommandButton Command3 
  23.       Caption         =   "Price"
  24.       Height          =   240
  25.       Left            =   3072
  26.       TabIndex        =   10
  27.       Top             =   2448
  28.       Width           =   1644
  29.    End
  30.    Begin CommandButton Command2 
  31.       Caption         =   "Description"
  32.       Height          =   240
  33.       Left            =   1152
  34.       TabIndex        =   9
  35.       Top             =   2448
  36.       Width           =   1884
  37.    End
  38.    Begin CommandButton Command1 
  39.       Caption         =   "Item"
  40.       Height          =   240
  41.       Left            =   48
  42.       TabIndex        =   8
  43.       Top             =   2448
  44.       Width           =   1068
  45.    End
  46.    Begin MListBox MList4 
  47.       AddItemHeight   =   0
  48.       Alignment       =   0  'None
  49.       AllowFocusRect  =   -1  'True
  50.       AutoCheck       =   -1  'True
  51.       BackColor       =   &H00C0C0C0&
  52.       BorderStyle     =   1  'Raised
  53.       CheckColor      =   &H00000000&
  54.       CheckStyle      =   0  'Cross Style
  55.       DefPicture      =   DEMO.FRX:0000
  56.       DrawRegions     =   1
  57.       EnableVirtualMsgs=   0   'False
  58.       ExtendedSelect  =   0   'False
  59.       FallColor       =   &H00808080&
  60.       FindDirection   =   0  'Forward
  61.       FindResult      =   0  'Update ListIndex
  62.       FontBold        =   0   'False
  63.       FontItalic      =   0   'False
  64.       FontName        =   "MS Sans Serif"
  65.       FontSize        =   8.25
  66.       FontStrikethru  =   0   'False
  67.       FontUnderline   =   0   'False
  68.       GridColor       =   &H00000000&
  69.       GridStyle       =   0  'Solid
  70.       Height          =   1524
  71.       HiliteBackColor =   &H00000000&
  72.       HiliteForeColor =   &H00000000&
  73.       HorizontalGrids =   0   'False
  74.       ImageRegion     =   0
  75.       ImageType       =   3  'Aligned Bitmap
  76.       ItemHeight      =   300
  77.       ItemWidth       =   1500
  78.       Left            =   4944
  79.       ListBoxStyle    =   0  'Fixed
  80.       MaskingColor    =   &H00C0C0C0&
  81.       MultiColumn     =   -1  'True
  82.       MultiSelect     =   0   'False
  83.       NoIntegralHeight=   0   'False
  84.       OwnerCompare    =   0   'False
  85.       OwnerDraw       =   0   'False
  86.       Partner         =   0
  87.       RiseColor       =   &H00FFFFFF&
  88.       SearchCompare   =   1  'Case Insensitive
  89.       SelectMode      =   0  'Normal
  90.       SortColumn      =   0
  91.       Sorted          =   0   'False
  92.       SortOrder       =   0  'Ascending
  93.       SortType        =   0  'String
  94.       StringCompare   =   0  'Case Sensitive
  95.       TabIndex        =   7
  96.       Top             =   2592
  97.       Version         =   "04.60"
  98.       VerticalGrids   =   0   'False
  99.       VirtualMsgZone  =   0
  100.       Width           =   3420
  101.    End
  102.    Begin MListBox MList3 
  103.       AddItemHeight   =   0
  104.       Alignment       =   1  'Left
  105.       AllowFocusRect  =   -1  'True
  106.       AutoCheck       =   -1  'True
  107.       BackColor       =   &H00C0C0C0&
  108.       BorderStyle     =   2  'Inset
  109.       CheckColor      =   &H00000000&
  110.       CheckStyle      =   0  'Cross Style
  111.       DefPicture      =   DEMO.FRX:011A
  112.       DrawRegions     =   1
  113.       EnableVirtualMsgs=   0   'False
  114.       ExtendedSelect  =   0   'False
  115.       FallColor       =   &H00808080&
  116.       FindDirection   =   0  'Forward
  117.       FindResult      =   0  'Update ListIndex
  118.       FontBold        =   0   'False
  119.       FontItalic      =   0   'False
  120.       FontName        =   "MS Sans Serif"
  121.       FontSize        =   8.25
  122.       FontStrikethru  =   0   'False
  123.       FontUnderline   =   0   'False
  124.       GridColor       =   &H00000000&
  125.       GridStyle       =   0  'Solid
  126.       Height          =   1515
  127.       HiliteBackColor =   &H00000000&
  128.       HiliteForeColor =   &H00FFFFFF&
  129.       HorizontalGrids =   0   'False
  130.       ImageRegion     =   0
  131.       ImageType       =   3  'Aligned Bitmap
  132.       ItemHeight      =   500
  133.       ItemWidth       =   780
  134.       Left            =   4944
  135.       ListBoxStyle    =   0  'Fixed
  136.       MaskingColor    =   &H00C0C0C0&
  137.       MultiColumn     =   0   'False
  138.       MultiSelect     =   0   'False
  139.       NoIntegralHeight=   0   'False
  140.       OwnerCompare    =   0   'False
  141.       OwnerDraw       =   0   'False
  142.       Partner         =   0
  143.       RiseColor       =   &H00FFFFFF&
  144.       SearchCompare   =   1  'Case Insensitive
  145.       SelectMode      =   0  'Normal
  146.       SortColumn      =   0
  147.       Sorted          =   0   'False
  148.       SortOrder       =   0  'Ascending
  149.       SortType        =   0  'String
  150.       StringCompare   =   0  'Case Sensitive
  151.       TabIndex        =   4
  152.       Top             =   480
  153.       Version         =   "04.60"
  154.       VerticalGrids   =   0   'False
  155.       VirtualMsgZone  =   0
  156.       Width           =   3420
  157.    End
  158.    Begin MListBox MList2 
  159.       AddItemHeight   =   0
  160.       Alignment       =   0  'None
  161.       AllowFocusRect  =   -1  'True
  162.       AutoCheck       =   -1  'True
  163.       BackColor       =   &H00FFFF00&
  164.       BorderStyle     =   0  'Normal
  165.       CheckColor      =   &H00000000&
  166.       CheckStyle      =   1  'Check Mark
  167.       DefPicture      =   DEMO.FRX:0234
  168.       DrawRegions     =   4
  169.       EnableVirtualMsgs=   -1  'True
  170.       ExtendedSelect  =   0   'False
  171.       FallColor       =   &H00808080&
  172.       FindDirection   =   0  'Forward
  173.       FindResult      =   0  'Update ListIndex
  174.       FontBold        =   0   'False
  175.       FontItalic      =   -1  'True
  176.       FontName        =   "MS Sans Serif"
  177.       FontSize        =   8.25
  178.       FontStrikethru  =   0   'False
  179.       FontUnderline   =   0   'False
  180.       ForeColor       =   &H00004080&
  181.       GridColor       =   &H00000000&
  182.       GridStyle       =   0  'Solid
  183.       Height          =   1524
  184.       HiliteBackColor =   &H00000000&
  185.       HiliteForeColor =   &H00000000&
  186.       HorizontalGrids =   0   'False
  187.       ImageRegion     =   1
  188.       ImageType       =   0  'None
  189.       ItemHeight      =   300
  190.       ItemWidth       =   780
  191.       Left            =   48
  192.       ListBoxStyle    =   0  'Fixed
  193.       MaskingColor    =   &H00C0C0C0&
  194.       MultiColumn     =   0   'False
  195.       MultiSelect     =   0   'False
  196.       NoIntegralHeight=   0   'False
  197.       OwnerCompare    =   0   'False
  198.       OwnerDraw       =   0   'False
  199.       Partner         =   0
  200.       RiseColor       =   &H00FFFFFF&
  201.       SearchCompare   =   1  'Case Insensitive
  202.       SelectMode      =   0  'Normal
  203.       SortColumn      =   1
  204.       Sorted          =   -1  'True
  205.       SortOrder       =   0  'Ascending
  206.       SortType        =   0  'String
  207.       StringCompare   =   0  'Case Sensitive
  208.       TabIndex        =   0
  209.       Top             =   2688
  210.       Version         =   "04.60"
  211.       VerticalGrids   =   0   'False
  212.       VirtualMsgZone  =   10
  213.       Width           =   4668
  214.    End
  215.    Begin MListBox MList1 
  216.       AddItemHeight   =   0
  217.       Alignment       =   0  'None
  218.       AllowFocusRect  =   -1  'True
  219.       AutoCheck       =   -1  'True
  220.       BorderStyle     =   0  'Normal
  221.       CheckColor      =   &H00000000&
  222.       CheckStyle      =   0  'Cross Style
  223.       DragIcon        =   DEMO.FRX:034E
  224.       DrawRegions     =   2
  225.       EnableVirtualMsgs=   0   'False
  226.       ExtendedSelect  =   -1  'True
  227.       FallColor       =   &H00808080&
  228.       FindDirection   =   0  'Forward
  229.       FindResult      =   0  'Update ListIndex
  230.       FontBold        =   0   'False
  231.       FontItalic      =   0   'False
  232.       FontName        =   "MS Sans Serif"
  233.       FontSize        =   8.25
  234.       FontStrikethru  =   0   'False
  235.       FontUnderline   =   0   'False
  236.       GridColor       =   &H00C0C0C0&
  237.       GridStyle       =   0  'Solid
  238.       Height          =   1785
  239.       HiliteBackColor =   &H00000000&
  240.       HiliteForeColor =   &H00000000&
  241.       HorizontalGrids =   -1  'True
  242.       ImageRegion     =   0
  243.       ImageType       =   0  'None
  244.       ItemHeight      =   195
  245.       ItemWidth       =   780
  246.       Left            =   45
  247.       ListBoxStyle    =   1  'Variable
  248.       MaskingColor    =   &H00FFFFFF&
  249.       MultiColumn     =   0   'False
  250.       MultiSelect     =   -1  'True
  251.       NoIntegralHeight=   0   'False
  252.       OwnerCompare    =   0   'False
  253.       OwnerDraw       =   0   'False
  254.       Partner         =   0
  255.       RiseColor       =   &H00FFFFFF&
  256.       SearchCompare   =   1  'Case Insensitive
  257.       SelectMode      =   1  'Drag Mode
  258.       SortColumn      =   0
  259.       Sorted          =   -1  'True
  260.       SortOrder       =   0  'Ascending
  261.       SortType        =   0  'String
  262.       StringCompare   =   0  'Case Sensitive
  263.       TabIndex        =   1
  264.       Top             =   450
  265.       Version         =   "04.60"
  266.       VerticalGrids   =   -1  'True
  267.       VirtualMsgZone  =   0
  268.       Width           =   4665
  269.    End
  270.    Begin Label Label4 
  271.       BorderStyle     =   1  'Fixed Single
  272.       Caption         =   "Multi-Column Style Bitmapped List Box"
  273.       Height          =   252
  274.       Left            =   4944
  275.       TabIndex        =   6
  276.       Top             =   2304
  277.       Width           =   3420
  278.    End
  279.    Begin Label Label3 
  280.       BorderStyle     =   1  'Fixed Single
  281.       Caption         =   "Bitmapped List Box"
  282.       Height          =   252
  283.       Left            =   4944
  284.       TabIndex        =   5
  285.       Top             =   144
  286.       Width           =   3420
  287.    End
  288.    Begin Image Image1 
  289.       Height          =   300
  290.       Left            =   90
  291.       Picture         =   DEMO.FRX:0650
  292.       Top             =   4170
  293.       Visible         =   0   'False
  294.       Width           =   225
  295.    End
  296.    Begin Label Label2 
  297.       BorderStyle     =   1  'Fixed Single
  298.       Caption         =   "Normal List Box - Color, Font, Bitmaps, CheckBoxes"
  299.       Height          =   252
  300.       Left            =   48
  301.       TabIndex        =   3
  302.       Top             =   2208
  303.       Width           =   4668
  304.    End
  305.    Begin Label Label1 
  306.       BorderStyle     =   1  'Fixed Single
  307.       Caption         =   "Multi-Select Sorted List Box/Drag Drop ---->"
  308.       Height          =   252
  309.       Left            =   48
  310.       TabIndex        =   2
  311.       Top             =   144
  312.       Width           =   4668
  313.    End
  314.    Begin Menu mnuMultiSelect 
  315.       Caption         =   "&Multi-Select"
  316.       Begin Menu mnuSelected 
  317.          Caption         =   "&Selected"
  318.       End
  319.       Begin Menu mnuMListCount 
  320.          Caption         =   "&ListCount"
  321.       End
  322.       Begin Menu mnuSelCount 
  323.          Caption         =   "Sel&Count"
  324.       End
  325.       Begin Menu mnuMListIndex 
  326.          Caption         =   "List&Index"
  327.       End
  328.       Begin Menu mnuRange 
  329.          Caption         =   "Select/&Deselect Range"
  330.       End
  331.       Begin Menu mnuFocus 
  332.          Caption         =   "&Focus"
  333.       End
  334.    End
  335.    Begin Menu mnuNormal 
  336.       Caption         =   "&Normal"
  337.       Begin Menu mnuText 
  338.          Caption         =   "&Text"
  339.       End
  340.       Begin Menu mnuListCount 
  341.          Caption         =   "&ListCount"
  342.       End
  343.       Begin Menu mnuListIndex 
  344.          Caption         =   "List&Index"
  345.       End
  346.       Begin Menu mnuNSep1 
  347.          Caption         =   "-"
  348.       End
  349.       Begin Menu mnuRegular 
  350.          Caption         =   "&Regular"
  351.          Checked         =   -1  'True
  352.       End
  353.       Begin Menu mnuBitmap 
  354.          Caption         =   "&Bitmap"
  355.       End
  356.       Begin Menu mnuCheckBox 
  357.          Caption         =   "&CheckBox"
  358.       End
  359.       Begin Menu mnuNSep2 
  360.          Caption         =   "-"
  361.       End
  362.       Begin Menu mnuCheckRange 
  363.          Caption         =   "Chec&k Range"
  364.          Enabled         =   0   'False
  365.       End
  366.    End
  367.    Begin Menu mnuBitmapped 
  368.       Caption         =   "&Bitmapped"
  369.       Begin Menu mnuLeft 
  370.          Caption         =   "&Left"
  371.       End
  372.       Begin Menu mnuTop 
  373.          Caption         =   "&Top"
  374.       End
  375.       Begin Menu mnuRight 
  376.          Caption         =   "&Right"
  377.       End
  378.       Begin Menu mnuBottom 
  379.          Caption         =   "&Bottom"
  380.       End
  381.    End
  382.    Begin Menu mnuMisc 
  383.       Caption         =   "M&isc"
  384.       Begin Menu mnuItemData 
  385.          Caption         =   "&ItemData"
  386.       End
  387.       Begin Menu mnuTopIndex 
  388.          Caption         =   "&TopIndex"
  389.       End
  390.       Begin Menu mnuNewIndex 
  391.          Caption         =   "&NewIndex"
  392.       End
  393.       Begin Menu mnuList 
  394.          Caption         =   "&List"
  395.       End
  396.       Begin Menu mnuActiveRegion 
  397.          Caption         =   "&ActiveRegion"
  398.       End
  399.       Begin Menu mnuListRegion 
  400.          Caption         =   "L&istRegion"
  401.       End
  402.       Begin Menu mnuChecked 
  403.          Caption         =   "Checked"
  404.       End
  405.       Begin Menu mnuCheckItem2 
  406.          Caption         =   "Check Item 2"
  407.       End
  408.       Begin Menu mnuUncheckTwo 
  409.          Caption         =   "Uncheck Item Two"
  410.       End
  411.       Begin Menu mnuTest 
  412.          Caption         =   "Test Horz. Scroll Bar"
  413.       End
  414.       Begin Menu mnuRemoveItem 
  415.          Caption         =   "&Remove Item"
  416.       End
  417.       Begin Menu mnuMove 
  418.          Caption         =   "&Move"
  419.       End
  420.       Begin Menu mnuTestFont 
  421.          Caption         =   "Test &Font"
  422.       End
  423.    End
  424. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  425. Const LB_SETCOLUMNWIDTH = &H400 + 22
  426. Sub Command1_Click ()
  427.   If MList2.SortColumn <> 1 Then
  428.     MList2.SortColumn = 1
  429.     MList2.Resort = 1
  430.   End If
  431. End Sub
  432. Sub Command2_Click ()
  433.   If MList2.SortColumn <> 2 Then
  434.     MList2.SortColumn = 2
  435.     MList2.Resort = 1
  436.   End If
  437. End Sub
  438. Sub Command3_Click ()
  439.   If MList2.SortColumn <> 3 Then
  440.     MList2.SortColumn = 3
  441.     MList2.Resort = 1
  442.   End If
  443. End Sub
  444. Sub Command4_Click ()
  445.   Debug.Print "MList2 Count: " + MList2.ListCount
  446. End Sub
  447. Sub Command5_Click ()
  448.   Debug.Print "MList2 Selected Text: " + MList2.Text
  449. End Sub
  450. Sub Command7_Click ()
  451.   MList2.TopIndex = 3
  452. End Sub
  453. Sub Command8_Click ()
  454.   Debug.Print "MList2.TopIndex = "; MList2.TopIndex
  455. End Sub
  456. Sub Form_Load ()
  457.   Const DT_RIGHT = 2
  458.   Const DT_VCENTER = 4
  459.   Const DT_SINGLELINE = 32
  460. ' Columns are separated by the Tab character
  461. ' We could set the number of columns ourselves by setting MList1.DrawRegions = ####
  462.   MList1.ItemLength(1) = 750
  463.   MList1.ItemLength(2) = 4000
  464.   ' Set MList1.ListBoxStyle to FIXED and uncomment these lines for a variable line
  465.   ' list box.  Uncomment the code in MList3.Click for more examples!
  466.   MList1.AddItemHeight = 195
  467.   MList1.AddItem "Item1" + Chr$(9) + "Information One"
  468.   MList1.AddItemHeight = 395
  469.   MList1.AddItem "Item2" + Chr$(9) + "Information Two"
  470.   MList1.IndItemHeight(1) = 395
  471.   MList1.AddItemHeight = 195
  472.   MList1.AddItem "Item3" + Chr$(9) + "Information Three"
  473.   MList1.AddItemHeight = 295
  474.   MList1.AddItem "Item4" + Chr$(9) + "Information Four"
  475.   MList1.AddItemHeight = 295
  476.   MList1.AddItem "Item1" + Chr$(9) + "Information One"
  477.   MList1.AddItemHeight = 195
  478.   MList1.AddItem "Item2" + Chr$(9) + "Information Two"
  479.   MList1.AddItemHeight = 295
  480.   MList1.AddItem "Item3" + Chr$(9) + "Information Three"
  481.   MList1.AddItemHeight = 195
  482.   MList1.AddItem "Item4" + Chr$(9) + "Information Four"
  483. ' Change the font of item 1
  484.   MList1.ItemFontName(1) = "MS Sans Serif"
  485.   MList1.ItemFontSize(1) = 7.8
  486.   MList1.ItemFontItalic(1) = True
  487.   MList1.ItemFontBold(1) = True
  488.   ' MList1.ItemFontUnderline(1) = True
  489.   ' MList1.ItemFontStrikeThru(1) = True
  490.   MList1.ItemFontSize(4) = 9
  491.   MList1.ItemFontName(4) = "Courier"
  492.   MList1.ItemFontItalic(4) = True
  493.   MList1.ItemFontBold(4) = True
  494.   MList1.ItemFontUnderline(4) = True
  495.   ' MList1.ItemFontStrikeThru(4) = True
  496. ' Print the default flags for item 1
  497.   Debug.Print "Item1 DrawFlags: " + MList1.DrawFlags(1)
  498.   Debug.Print "Font Size: "; MList1.ItemFontSize(1)
  499.   Debug.Print "Font Name: "; MList1.ItemFontName(1)
  500.   Debug.Print "Italic:    "; MList1.ItemFontItalic(1)
  501.   Debug.Print "Bold:      "; MList1.ItemFontBold(1)
  502.   Debug.Print "Underline: "; MList1.ItemFontUnderline(1)
  503.   Debug.Print "StrikeThru:"; MList1.ItemFontStrikeThru(1)
  504. ' When you set or change DrawRegions, the default flags are DT_LEFT + DT_VCENTER + DT_SINGLELINE
  505. ' You can set the flags to any legal value used by the Windows API call DrawText
  506. ' Change the dollar column to be right justified instead
  507.   MList2.DrawFlags(3) = DT_RIGHT + DT_VCENTER + DT_SINGLELINE
  508.   Dim I As Integer
  509.   For I = 0 To 4
  510.     MList2.AddItem "Item1" + Chr$(9) + "Information One" + Chr$(9) + "$45.00"
  511.     MList2.AddItem "Item2" + Chr$(9) + "Information Two" + Chr$(9) + "$36.69"
  512.     MList2.AddItem "Item3" + Chr$(9) + "Information Three" + Chr$(9) + "$2234.00"
  513.     MList2.AddItem "Item4" + Chr$(9) + "Information Four" + Chr$(9) + "$4.00"
  514.     MList2.AddItem "Item5" + Chr$(9) + "Information Five" + Chr$(9) + "$0.25"
  515.   Next I
  516.   MList2.ItemLength(1) = 1000
  517.   MList2.ItemLength(2) = 1700
  518.   MList2.ItemLength(3) = 1300
  519.   MList2.ItemForeColor(1) = RGB(255, 255, 255)
  520.   MList2.ItemBkColor(1) = RGB(0, 0, 0)
  521.   MList2.ItemHiliteForeColor(1) = RGB(255, 0, 0)
  522.   MList2.ItemHiliteBackColor(1) = RGB(0, 0, 255)
  523.   MList2.HiliteBackColor = RGB(192, 192, 192)
  524.   MList2.HiliteForeColor = RGB(0, 0, 0)
  525.   MList2.ItemData(0) = 199
  526.   MList2.ItemData(1) = 200
  527.   MList2.ItemData(2) = 201
  528.   MList2.ItemData(3) = 202
  529.   MList2.ItemData(4) = 203
  530.   MList2.ItemData(5) = 204
  531.   MList2.ItemData(6) = 205
  532.   MList2.ItemData(7) = 206
  533.   MList2.ItemData(8) = 207
  534.   MList2.ItemData(9) = 208
  535.   MList2.ItemData(10) = 209
  536.   MList2.ItemData(11) = 210
  537.   MList2.ItemData(12) = 211
  538.   MList2.ItemData(13) = 212
  539.   MList2.ItemData(14) = 213
  540. ' Print the default flags for item 1
  541.   Debug.Print "Item3 DrawFlags: " + MList2.DrawFlags(3)
  542.   Debug.Print "ItemLength(2): "; MList2.ItemLength(2)
  543.   MList3.AddItem "Bitmap string one"
  544.   MList3.AddItem "Bitmap string two"
  545.   MList3.AddItem "Bitmap string three"
  546.   MList3.AddItem "Bitmap string four"
  547.   MList3.AddItem "Bitmap string five"
  548.   MList3.ItemPicture(1) = Image1.Picture
  549.   Dim X As Integer
  550.   For X = 1 To 20
  551.     MList4.AddItem "DOC" + Trim$(Str$(X)) + ".DOC"
  552.   Next X
  553.   MList4.ItemPicture(4) = Image1.Picture
  554.   ' X = SendMessage(MList4.hWnd, LB_SETCOLUMNWIDTH, 100, 0)
  555. End Sub
  556. Sub MList1_Click ()
  557.   ' MsgBox "Multi-Select List Box Click", 0, "MList1"
  558. End Sub
  559. Sub MList1_DblClick ()
  560. '  MsgBox "Multi-Select List Box Double Click", 0, "MList1"
  561. End Sub
  562. Sub MList1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  563.   If Button And 1 Then MList1.Drag 1
  564. End Sub
  565. Sub MList1_SelChange ()
  566.   Debug.Print "MList1 SelChange"; MList1.ListIndex; " - "; MList1.ClickRegion
  567. End Sub
  568. Sub MList2_CompareItem (Item1 As String, Item2 As String, Result As Long)
  569.   Result = StrComp(Item1, Item2)
  570.   ' Debug.Print Item1 + ":" + Item2 + ":" + Str$(Result)
  571. End Sub
  572. Sub MList2_DblClick ()
  573.   If MList2.ImageType = 1 Then
  574.     If MList2.ItemPicture(MList2.ListIndex) <> Image1.Picture Then
  575.       MList2.ItemPicture(MList2.ListIndex) = Image1.Picture
  576.     Else
  577.       MList2.ItemPicture(MList2.ListIndex) = MList2.DefPicture
  578.     End If
  579.   End If
  580. End Sub
  581. Sub MList2_KeyPress (KeyAscii As Integer)
  582.   If MList2.ImageType = 1 Then
  583.     If MList2.ItemPicture(MList2.ListIndex) <> Image1.Picture Then
  584.       MList2.ItemPicture(MList2.ListIndex) = Image1.Picture
  585.     Else
  586.       MList2.ItemPicture(MList2.ListIndex) = MList2.DefPicture
  587.     End If
  588.   Else
  589.     If KeyAscii = 32 Then
  590.       MList2.Checked(MList2.ListIndex) = Not MList2.Checked(MList2.ListIndex)
  591.     End If
  592.   End If
  593. End Sub
  594. Sub MList2_ScrollMessage (Offset As Integer)
  595.   Debug.Print "Scroll Message:" + Str$(Offset)
  596. End Sub
  597. Sub MList2_SelChange ()
  598.   Debug.Print "SelChange on line "; MList2.ListIndex; " - "; MList2.ClickRegion
  599. End Sub
  600. Sub MList2_SelCheck (Index As Integer, CheckState As Integer)
  601.   Dim aString As String
  602.   If CheckState Then
  603.     aString = " On"
  604.   Else
  605.     aString = " Off"
  606.   End If
  607.   Debug.Print "Line "; Index; " is"; aString
  608. End Sub
  609. Sub MList2_VirtualMessage (Message As Integer)
  610.   Dim aString As String
  611.   Select Case Message
  612.     Case 1
  613.       aString = "Add At Bottom"
  614.     Case 2
  615.       aString = "Add At Top"
  616.     Case 3
  617.       aString = "Home"
  618.     Case 4
  619.       aString = "End"
  620.   End Select
  621.   Debug.Print "Scroll Message: "; aString
  622. End Sub
  623. Sub MList3_Click ()
  624.   ' Uncomment this line to test adjusting individual line heights
  625.   ' MList1.IndItemHeight(2) = 495
  626. End Sub
  627. Sub MList3_DragDrop (Source As Control, X As Single, Y As Single)
  628.   MList3.ItemX = X
  629.   MList3.ItemY = Y
  630.   Debug.Print "MList3 has been dropped upon at Item" + Str$(MList3.Item) + "!"
  631. End Sub
  632. Sub MList3_DragOver (Source As Control, X As Single, Y As Single, State As Integer)
  633.   MList3.ItemX = X
  634.   MList3.ItemY = Y
  635.   If MList3.ListIndex <> MList3.Item Then MList3.ListIndex = MList3.Item
  636. End Sub
  637. Sub mnuActiveRegion_Click ()
  638.   MList2.ActiveRegion = 2
  639.   If MList2.ListIndex <> -1 Then
  640.     Dim aString As String
  641.     aString = "MList2.TextRegion = " + MList2.TextRegion
  642.     MsgBox aString, 0, "MList2"
  643.     MList2.TextRegion = "Replace"
  644.     MList2.ActiveRegion = 3
  645.     MList2.TextRegion = "$1.00"
  646.   End If
  647.   aString = "MList2.ListRegion(3) = " + MList2.ListRegion(3)
  648.   MsgBox aString, 0, "MList2"
  649.   MList2.ListRegion(3) = "Replace"
  650.   MList1.ActiveRegion = 2
  651.   If MList1.ListIndex <> -1 Then
  652.     aString = "MList1.TextRegion = " + MList1.TextRegion
  653.     MsgBox aString, 0, "MList1"
  654.     MList1.TextRegion = "Replace"
  655.   End If
  656. End Sub
  657. Sub mnuBitmap_Click ()
  658.     If mnuBitmap.Checked Then
  659.         Exit Sub
  660.     End If
  661.     mnuRegular.Checked = False
  662.     mnuBitmap.Checked = True
  663.     mnuCheckBox.Checked = False
  664.     mnuCheckRange.Enabled = False
  665.   MList2.ItemLength(1) = 300
  666.   MList2.ItemLength(2) = 1000
  667.   MList2.ItemLength(3) = 1700
  668.   MList2.ItemLength(4) = 1300
  669.   MList2.ItemPicture(1) = Image1.Picture
  670.   If MList2.ImageType <> 1 Then
  671.     MList2.ImageType = 1
  672.     MList2.Refresh
  673.     MList2.ItemBkColor(1) = MList2.BackColor
  674.     MList2.ItemForeColor(1) = MList2.ForeColor
  675.   End If
  676. End Sub
  677. Sub mnuBottom_Click ()
  678.   MList3.Alignment = 4
  679.   MList3.Refresh
  680. End Sub
  681. Sub mnuCheckBox_Click ()
  682.     If mnuCheckBox.Checked Then
  683.         Exit Sub
  684.     End If
  685.     mnuRegular.Checked = False
  686.     mnuBitmap.Checked = False
  687.     mnuCheckBox.Checked = True
  688.     mnuCheckRange.Enabled = True
  689.     MList2.ItemLength(1) = 300
  690.     MList2.ItemLength(2) = 1000
  691.     MList2.ItemLength(3) = 1700
  692.     MList2.ItemLength(4) = 1300
  693.     If MList2.ImageType <> 2 Then
  694.         MList2.ImageType = 2
  695.         MList2.Refresh
  696.         MList2.ItemBkColor(1) = MList2.BackColor
  697.         MList2.ItemForeColor(1) = MList2.ForeColor
  698.     End If
  699. End Sub
  700. Sub mnuChecked_Click ()
  701.   MList2.Checked(1) = True
  702.   Dim X%
  703.   For X% = 0 To MList2.ListCount - 1
  704.     If MList2.Checked(X%) Then
  705.       Debug.Print "MList2.Checked("; X%; ") = Checked"
  706.     Else
  707.       Debug.Print "MList2.Checked("; X%; ") = Unchecked"
  708.     End If
  709.   Next X%
  710. End Sub
  711. Sub mnuCheckItem2_Click ()
  712.   If MList2.ImageType = 2 Then
  713.     MList2.Checked(2) = True
  714.   End If
  715. End Sub
  716. Sub mnuCheckRange_Click ()
  717.     If mnuCheckRange.Caption = "Chec&k Range" Then
  718.         mnuCheckRange.Caption = "&Uncheck Range"
  719.     Else
  720.         mnuCheckRange.Caption = "Chec&k Range"
  721.     End If
  722.     If MList2.ImageType = 2 Then
  723.         MList2.RangeStart = 0
  724.         MList2.RangeEnd = 3
  725.         If MList2.Checked(0) Then
  726.             MList2.RangeChecked = False
  727.         Else
  728.             MList2.RangeChecked = True
  729.         End If
  730.     End If
  731. End Sub
  732. Sub mnuFocus_Click ()
  733.   MList1.SetFocus
  734. End Sub
  735. Sub mnuItemData_Click ()
  736.   Dim Count As Integer
  737.   Dim X As Integer
  738.   Dim aString As String
  739.   Count = MList2.ListCount
  740.   For X = 0 To Count - 1
  741.     Debug.Print "ItemData" + Str$(X) + ": " + Str$(MList2.ItemData(X))
  742.   Next
  743. End Sub
  744. Sub mnuLeft_Click ()
  745.   MList3.Alignment = 1
  746.   MList3.Refresh
  747. End Sub
  748. Sub mnuList_Click ()
  749.   For I = 0 To MList2.ListCount - 1
  750.     Debug.Print I; " - "; MList2.List(I)
  751.   Next I
  752.   MList2.List(2) = "Rep" + Chr$(9) + "Replacement" + Chr$(9) + "$100.00"
  753. End Sub
  754. Sub mnuListCount_Click ()
  755.   Dim aString As String
  756.   aString = "MList2.ListCount = " + Str$(MList2.ListCount)
  757.   MsgBox aString, 0, "MList2"
  758. End Sub
  759. Sub mnuListIndex_Click ()
  760.   Dim aString As String
  761.   aString = "MList2.ListIndex = " + Str$(MList2.ListIndex)
  762.   MsgBox aString, 0, "MList2"
  763.   MList2.ListIndex = 2
  764. End Sub
  765. Sub mnuListRegion_Click ()
  766.   MList1.ListIndex = 4
  767.   MList1.ActiveRegion = 1
  768.   MList1.ListRegion(4) = "List"
  769.   MList1.ActiveRegion = 2
  770.   MList1.TextRegion = "Change by menu"
  771. End Sub
  772. Sub mnuMListCount_Click ()
  773.   Dim aString As String
  774.   aString = "MList1.ListCount = " + Str$(MList1.ListCount)
  775.   MsgBox aString, 0, "MList1"
  776. End Sub
  777. Sub mnuMListIndex_Click ()
  778.   Dim aString As String
  779.   aString = "MList1.ListIndex = " + Str$(MList1.ListIndex)
  780.   MsgBox aString, 0, "MList1"
  781.   MList1.ListIndex = 2
  782. End Sub
  783. Sub mnuMove_Click ()
  784.   MList1.Move 0, 0
  785. End Sub
  786. Sub mnuMSText_Click ()
  787.   MsgBox MList1.Text, 0, "Text-MList1"
  788. End Sub
  789. Sub mnuNewIndex_Click ()
  790.   MList1.AddItem "Item21" + Chr$(9) + "Information TwoOne"
  791.   Dim aString As String
  792.   aString = "MList1.NewIndex = " + Str$(MList1.NewIndex)
  793.   MsgBox aString, 0, "MList1"
  794. End Sub
  795. Sub mnuRange_Click ()
  796.   MList1.RangeStart = 0
  797.   MList1.RangeEnd = 3
  798.   If MList1.Selected(1) Then
  799.     MList1.RangeSelected = False
  800.   Else
  801.     MList1.RangeSelected = True
  802.   End If
  803. End Sub
  804. Sub mnuRegular_Click ()
  805.     If mnuRegular.Checked Then
  806.         Exit Sub
  807.     End If
  808.     mnuRegular.Checked = True
  809.     mnuBitmap.Checked = False
  810.     mnuCheckBox.Checked = False
  811.     mnuCheckRange.Enabled = False
  812.     MList2.ItemLength(1) = 1000
  813.     MList2.ItemLength(2) = 1700
  814.     MList2.ItemLength(3) = 1300
  815.     If MList2.ImageType Then
  816.         MList2.ImageType = 0
  817.         MList2.Refresh
  818.         MList2.ItemForeColor(1) = RGB(255, 255, 255)
  819.         MList2.ItemBkColor(1) = RGB(0, 0, 0)
  820.     End If
  821. End Sub
  822. Sub mnuRemoveItem_Click ()
  823.   MList2.RemoveItem 2
  824. End Sub
  825. Sub mnuRight_Click ()
  826.   MList3.Alignment = 3
  827.   MList3.Refresh
  828. End Sub
  829. Sub mnuSelCount_Click ()
  830.   Dim aString As String
  831.   aString = "MList1.SelCount = " + Str$(MList1.SelCount)
  832.   MsgBox aString, 0, "MList1"
  833. End Sub
  834. Sub mnuSelected_Click ()
  835.   Dim Count As Integer
  836.   Dim X As Integer
  837.   Dim aString As String
  838.   Count = MList1.ListCount
  839.   If MList1.SelCount Then
  840.     For X = 0 To Count - 1
  841.       If MList1.Selected(X) Then
  842.         aString = "True"
  843.       Else
  844.         aString = "False"
  845.       End If
  846.       Debug.Print "Item" + Str$(X) + ": " + aString
  847.     Next
  848.   End If
  849. End Sub
  850. Sub mnuTest_Click ()
  851.   MList2.ImageType = 0
  852.   MList2.ItemLength(1) = 1000
  853.   MList2.ItemLength(2) = 1000
  854.   MList2.ItemLength(3) = 1700
  855.   MList2.ItemLength(4) = 1300
  856.   MList2.SetHzScroll = True
  857. End Sub
  858. Sub mnuTestFont_Click ()
  859.   MList1.ItemFont(0) = MList1.ItemFont(4)
  860. End Sub
  861. Sub mnuText_Click ()
  862.   MsgBox MList2.Text, 0, "MList2"
  863. End Sub
  864. Sub mnuTop_Click ()
  865.   MList3.Alignment = 2
  866.   MList3.Refresh
  867. End Sub
  868. Sub mnuTopIndex_Click ()
  869.   MList2.TopIndex = 6
  870.   Dim aString As String
  871.   aString = "MList2.TopIndex = " + Str$(MList2.TopIndex)
  872.   MsgBox aString, 0, "MList2"
  873. End Sub
  874. Sub mnuUncheckTwo_Click ()
  875.   If MList2.ImageType = 2 Then
  876.     MList2.Checked(2) = False
  877.   End If
  878. End Sub
  879.