home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / mlist_45 / form1.frm < prev    next >
Text File  |  1994-04-27  |  25KB  |  1,014 lines

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