home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / MLIST_45 / FORM1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-04-27  |  24.9 KB  |  791 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. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  374. Const LB_SETCOLUMNWIDTH = &H400 + 22
  375. Sub Command1_Click ()
  376.   If MList2.SortColumn <> 1 Then
  377.     MList2.SortColumn = 1
  378.     MList2.Resort = 1
  379.   End If
  380. End Sub
  381. Sub Command2_Click ()
  382.   If MList2.SortColumn <> 2 Then
  383.     MList2.SortColumn = 2
  384.     MList2.Resort = 1
  385.   End If
  386. End Sub
  387. Sub Command3_Click ()
  388.   If MList2.SortColumn <> 3 Then
  389.     MList2.SortColumn = 3
  390.     MList2.Resort = 1
  391.   End If
  392. End Sub
  393. Sub Command4_Click ()
  394.   Debug.Print "MList2 Count: " + MList2.ListCount
  395. End Sub
  396. Sub Command5_Click ()
  397.   Debug.Print "MList2 Selected Text: " + MList2.Text
  398. End Sub
  399. Sub Command7_Click ()
  400.   MList2.TopIndex = 3
  401. End Sub
  402. Sub Command8_Click ()
  403.   Debug.Print "MList2.TopIndex = "; MList2.TopIndex
  404. End Sub
  405. Sub Form_Load ()
  406.   Const DT_RIGHT = 2
  407.   Const DT_VCENTER = 4
  408.   Const DT_SINGLELINE = 32
  409. ' Columns are separated by the Tab character
  410. ' We could set the number of columns ourselves by setting MList1.DrawRegions = ####
  411.   MList1.ItemLength(1) = 750
  412.   MList1.ItemLength(2) = 4000
  413.   ' Set MList1.ListBoxStyle to FIXED and uncomment these lines for a variable line
  414.   ' list box.  Uncomment the code in MList3.Click for more examples!
  415.   ' MList1.AddItemHeight = 195
  416.   MList1.AddItem "Item1" + Chr$(9) + "Information One"
  417.   ' MList1.AddItemHeight = 295
  418.   MList1.AddItem "Item2" + Chr$(9) + "Information Two"
  419.   ' MList1.AddItemHeight = 195
  420.   MList1.AddItem "Item3" + Chr$(9) + "Information Three"
  421.   ' MList1.AddItemHeight = 295
  422.   MList1.AddItem "Item4" + Chr$(9) + "Information Four"
  423.   ' MList1.AddItemHeight = 295
  424.   MList1.AddItem "Item1" + Chr$(9) + "Information One"
  425.   ' MList1.AddItemHeight = 195
  426.   MList1.AddItem "Item2" + Chr$(9) + "Information Two"
  427.   ' MList1.AddItemHeight = 295
  428.   MList1.AddItem "Item3" + Chr$(9) + "Information Three"
  429.   ' MList1.AddItemHeight = 195
  430.   MList1.AddItem "Item4" + Chr$(9) + "Information Four"
  431. ' Change the font of item 1
  432.   MList1.ItemFontName(1) = "MS Sans Serif"
  433.   MList1.ItemFontSize(1) = 7.8
  434.   MList1.ItemFontItalic(1) = True
  435.   MList1.ItemFontBold(1) = True
  436.   ' MList1.ItemFontUnderline(1) = True
  437.   ' MList1.ItemFontStrikeThru(1) = True
  438.   MList1.ItemFontSize(4) = 9
  439.   MList1.ItemFontName(4) = "Courier"
  440.   MList1.ItemFontItalic(4) = True
  441.   MList1.ItemFontBold(4) = True
  442.   MList1.ItemFontUnderline(4) = True
  443.   ' MList1.ItemFontStrikeThru(4) = True
  444. ' Print the default flags for item 1
  445.   Debug.Print "Item1 DrawFlags: " + MList1.DrawFlags(1)
  446.   Debug.Print "Font Size: "; MList1.ItemFontSize(1)
  447.   Debug.Print "Font Name: "; MList1.ItemFontName(1)
  448.   Debug.Print "Italic:    "; MList1.ItemFontItalic(1)
  449.   Debug.Print "Bold:      "; MList1.ItemFontBold(1)
  450.   Debug.Print "Underline: "; MList1.ItemFontUnderline(1)
  451.   Debug.Print "StrikeThru:"; MList1.ItemFontStrikeThru(1)
  452. ' When you set or change DrawRegions, the default flags are DT_LEFT + DT_VCENTER + DT_SINGLELINE
  453. ' You can set the flags to any legal value used by the Windows API call DrawText
  454. ' Change the dollar column to be right justified instead
  455.   MList2.DrawFlags(3) = DT_RIGHT + DT_VCENTER + DT_SINGLELINE
  456.   Dim I As Integer
  457.   For I = 0 To 4
  458.     MList2.AddItem "Item1" + Chr$(9) + "Information One" + Chr$(9) + "$45.00"
  459.     MList2.AddItem "Item2" + Chr$(9) + "Information Two" + Chr$(9) + "$36.69"
  460.     MList2.AddItem "Item3" + Chr$(9) + "Information Three" + Chr$(9) + "$2234.00"
  461.     MList2.AddItem "Item4" + Chr$(9) + "Information Four" + Chr$(9) + "$4.00"
  462.     MList2.AddItem "Item5" + Chr$(9) + "Information Five" + Chr$(9) + "$0.25"
  463.   Next I
  464.   MList2.ItemLength(1) = 1000
  465.   MList2.ItemLength(2) = 1700
  466.   MList2.ItemLength(3) = 1300
  467.   MList2.ItemForeColor(1) = RGB(255, 255, 255)
  468.   MList2.ItemBkColor(1) = RGB(0, 0, 0)
  469.   MList2.ItemHiliteForeColor(1) = RGB(255, 0, 0)
  470.   MList2.ItemHiliteBackColor(1) = RGB(0, 0, 255)
  471.   MList2.HiliteBackColor = RGB(192, 192, 192)
  472.   MList2.HiliteForeColor = RGB(0, 0, 0)
  473.   MList2.ItemData(0) = 199
  474.   MList2.ItemData(1) = 200
  475.   MList2.ItemData(2) = 201
  476.   MList2.ItemData(3) = 202
  477.   MList2.ItemData(4) = 203
  478.   MList2.ItemData(5) = 204
  479.   MList2.ItemData(6) = 205
  480.   MList2.ItemData(7) = 206
  481.   MList2.ItemData(8) = 207
  482.   MList2.ItemData(9) = 208
  483.   MList2.ItemData(10) = 209
  484.   MList2.ItemData(11) = 210
  485.   MList2.ItemData(12) = 211
  486.   MList2.ItemData(13) = 212
  487.   MList2.ItemData(14) = 213
  488. ' Print the default flags for item 1
  489.   Debug.Print "Item3 DrawFlags: " + MList2.DrawFlags(3)
  490.   Debug.Print "ItemLength(2): "; MList2.ItemLength(2)
  491.   MList3.AddItem "Bitmap string one"
  492.   MList3.AddItem "Bitmap string two"
  493.   MList3.AddItem "Bitmap string three"
  494.   MList3.AddItem "Bitmap string four"
  495.   MList3.AddItem "Bitmap string five"
  496.   MList3.ItemPicture(1) = Image1.Picture
  497.   Dim X As Integer
  498.   For X = 1 To 20
  499.     MList4.AddItem "DOC" + Trim$(Str$(X)) + ".DOC"
  500.   Next X
  501.   MList4.ItemPicture(4) = Image1.Picture
  502.   ' X = SendMessage(MList4.hWnd, LB_SETCOLUMNWIDTH, 100, 0)
  503. End Sub
  504. Sub MList1_Click ()
  505.   ' MsgBox "Multi-Select List Box Click", 0, "MList1"
  506. End Sub
  507. Sub MList1_DblClick ()
  508. '  MsgBox "Multi-Select List Box Double Click", 0, "MList1"
  509. End Sub
  510. Sub MList1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  511.   If Button And 1 Then MList1.Drag 1
  512. End Sub
  513. Sub MList2_DblClick ()
  514.   If MList2.ImageType = 1 Then
  515.     If MList2.ItemPicture(MList2.ListIndex) <> Image1.Picture Then
  516.       MList2.ItemPicture(MList2.ListIndex) = Image1.Picture
  517.     Else
  518.       MList2.ItemPicture(MList2.ListIndex) = MList2.DefPicture
  519.     End If
  520.   End If
  521. End Sub
  522. Sub MList2_KeyPress (KeyAscii As Integer)
  523.   If MList2.ImageType = 1 Then
  524.     If MList2.ItemPicture(MList2.ListIndex) <> Image1.Picture Then
  525.       MList2.ItemPicture(MList2.ListIndex) = Image1.Picture
  526.     Else
  527.       MList2.ItemPicture(MList2.ListIndex) = MList2.DefPicture
  528.     End If
  529.   Else
  530.     If KeyAscii = 32 Then
  531.       MList2.Checked(MList2.ListIndex) = Not MList2.Checked(MList2.ListIndex)
  532.     End If
  533.   End If
  534. End Sub
  535. Sub MList2_ScrollMessage (Offset As Integer)
  536.   Debug.Print "Scroll Message:" + Str$(Offset)
  537. End Sub
  538. Sub MList2_SelChange ()
  539.   Debug.Print "SelChange on line "; MList2.ListIndex
  540. End Sub
  541. Sub MList2_SelCheck (Index As Integer, CheckState As Integer)
  542.   Dim aString As String
  543.   If CheckState Then
  544.     aString = " On"
  545.   Else
  546.     aString = " Off"
  547.   End If
  548.   Debug.Print "Line "; Index; " is"; aString
  549. End Sub
  550. Sub MList2_VirtualMessage (Message As Integer)
  551.   Dim aString As String
  552.   Select Case Message
  553.     Case 1
  554.       aString = "Add At Bottom"
  555.     Case 2
  556.       aString = "Add At Top"
  557.     Case 3
  558.       aString = "Home"
  559.     Case 4
  560.       aString = "End"
  561.   End Select
  562.   Debug.Print "Scroll Message: "; aString
  563. End Sub
  564. Sub MList3_Click ()
  565.   ' Uncomment this line to test adjusting individual line heights
  566.   ' MList1.IndItemHeight(2) = 495
  567. End Sub
  568. Sub MList3_DragDrop (Source As Control, X As Single, Y As Single)
  569.   MList3.ItemX = X
  570.   MList3.ItemY = Y
  571.   Debug.Print "MList3 has been dropped upon at Item" + Str$(MList3.Item) + "!"
  572. End Sub
  573. Sub MList3_DragOver (Source As Control, X As Single, Y As Single, State As Integer)
  574.   MList3.ItemX = X
  575.   MList3.ItemY = Y
  576.   If MList3.ListIndex <> MList3.Item Then MList3.ListIndex = MList3.Item
  577. End Sub
  578. Sub mnuActiveRegion_Click ()
  579.   MList2.ActiveRegion = 2
  580.   If MList2.ListIndex <> -1 Then
  581.     Dim aString As String
  582.     aString = "MList2.TextRegion = " + MList2.TextRegion
  583.     MsgBox aString, 0, "MList2"
  584.     MList2.TextRegion = "Replace"
  585.     MList2.ActiveRegion = 3
  586.     MList2.TextRegion = "$1.00"
  587.   End If
  588.   aString = "MList2.ListRegion(3) = " + MList2.ListRegion(3)
  589.   MsgBox aString, 0, "MList2"
  590.   MList2.ListRegion(3) = "Replace"
  591.   MList1.ActiveRegion = 1
  592.   If MList1.ListIndex <> -1 Then
  593.     aString = "MList1.TextRegion = " + MList1.TextRegion
  594.     MsgBox aString, 0, "MList1"
  595.     MList1.TextRegion = "Replace"
  596.   End If
  597. End Sub
  598. Sub mnuBitmap_Click ()
  599.   MList2.ItemLength(1) = 300
  600.   MList2.ItemLength(2) = 1000
  601.   MList2.ItemLength(3) = 1700
  602.   MList2.ItemLength(4) = 1300
  603.   MList2.ItemPicture(1) = Image1.Picture
  604.   If MList2.ImageType <> 1 Then
  605.     MList2.ImageType = 1
  606.     MList2.Refresh
  607.     MList2.ItemBkColor(1) = MList2.BackColor
  608.     MList2.ItemForeColor(1) = MList2.ForeColor
  609.   End If
  610. End Sub
  611. Sub mnuBottom_Click ()
  612.   MList3.Alignment = 4
  613.   MList3.Refresh
  614. End Sub
  615. Sub mnuCheckBox_Click ()
  616.   MList2.ItemLength(1) = 300
  617.   MList2.ItemLength(2) = 1000
  618.   MList2.ItemLength(3) = 1700
  619.   MList2.ItemLength(4) = 1300
  620.   If MList2.ImageType <> 2 Then
  621.     MList2.ImageType = 2
  622.     MList2.Refresh
  623.     MList2.ItemBkColor(1) = MList2.BackColor
  624.     MList2.ItemForeColor(1) = MList2.ForeColor
  625.   End If
  626. End Sub
  627. Sub mnuChecked_Click ()
  628.   MList2.Checked(1) = True
  629.   Dim X%
  630.   For X% = 0 To MList2.ListCount - 1
  631.     If MList2.Checked(X%) Then
  632.       Debug.Print "MList2.Checked("; X%; ") = Checked"
  633.     Else
  634.       Debug.Print "MList2.Checked("; X%; ") = Unchecked"
  635.     End If
  636.   Next X%
  637. End Sub
  638. Sub mnuCheckItem2_Click ()
  639.   If MList2.ImageType = 2 Then
  640.     MList2.Checked(2) = True
  641.   End If
  642. End Sub
  643. Sub mnuCheckRange_Click ()
  644.   If MList2.ImageType = 2 Then
  645.     MList2.RangeStart = 0
  646.     MList2.RangeEnd = 3
  647.     If MList2.Checked(0) Then
  648.       MList2.RangeChecked = False
  649.     Else
  650.       MList2.RangeChecked = True
  651.     End If
  652.   End If
  653. End Sub
  654. Sub mnuFocus_Click ()
  655.   MList1.SetFocus
  656. End Sub
  657. Sub mnuItemData_Click ()
  658.   Dim Count As Integer
  659.   Dim X As Integer
  660.   Dim aString As String
  661.   Count = MList2.ListCount
  662.   For X = 0 To Count - 1
  663.     Debug.Print "ItemData" + Str$(X) + ": " + Str$(MList2.ItemData(X))
  664.   Next
  665. End Sub
  666. Sub mnuLeft_Click ()
  667.   MList3.Alignment = 1
  668.   MList3.Refresh
  669. End Sub
  670. Sub mnuList_Click ()
  671.   For I = 0 To MList2.ListCount - 1
  672.     Debug.Print I; " - "; MList2.List(I)
  673.   Next I
  674.   MList2.List(2) = "Rep" + Chr$(9) + "Replacement" + Chr$(9) + "$100.00"
  675. End Sub
  676. Sub mnuListCount_Click ()
  677.   Dim aString As String
  678.   aString = "MList2.ListCount = " + Str$(MList2.ListCount)
  679.   MsgBox aString, 0, "MList2"
  680. End Sub
  681. Sub mnuListIndex_Click ()
  682.   Dim aString As String
  683.   aString = "MList2.ListIndex = " + Str$(MList2.ListIndex)
  684.   MsgBox aString, 0, "MList2"
  685.   MList2.ListIndex = 2
  686. End Sub
  687. Sub mnuListRegion_Click ()
  688.   MList1.ListIndex = 4
  689.   MList1.ActiveRegion = 1
  690.   MList1.ListRegion(4) = "List"
  691.   MList1.ActiveRegion = 2
  692.   MList1.TextRegion = "Change by menu"
  693. End Sub
  694. Sub mnuMListCount_Click ()
  695.   Dim aString As String
  696.   aString = "MList1.ListCount = " + Str$(MList1.ListCount)
  697.   MsgBox aString, 0, "MList1"
  698. End Sub
  699. Sub mnuMListIndex_Click ()
  700.   Dim aString As String
  701.   aString = "MList1.ListIndex = " + Str$(MList1.ListIndex)
  702.   MsgBox aString, 0, "MList1"
  703.   MList1.ListIndex = 2
  704. End Sub
  705. Sub mnuMove_Click ()
  706.   MList1.Move 0, 0
  707. End Sub
  708. Sub mnuMSText_Click ()
  709.   MsgBox MList1.Text, 0, "Text-MList1"
  710. End Sub
  711. Sub mnuNewIndex_Click ()
  712.   MList1.AddItem "Item21" + Chr$(9) + "Information TwoOne"
  713.   Dim aString As String
  714.   aString = "MList1.NewIndex = " + Str$(MList1.NewIndex)
  715.   MsgBox aString, 0, "MList1"
  716. End Sub
  717. Sub mnuRange_Click ()
  718.   MList1.RangeStart = 0
  719.   MList1.RangeEnd = 3
  720.   If MList1.Selected(1) Then
  721.     MList1.RangeSelected = False
  722.   Else
  723.     MList1.RangeSelected = True
  724.   End If
  725. End Sub
  726. Sub mnuRegular_Click ()
  727.   MList2.ItemLength(1) = 1000
  728.   MList2.ItemLength(2) = 1700
  729.   MList2.ItemLength(3) = 1300
  730.   If MList2.ImageType Then
  731.     MList2.ImageType = 0
  732.     MList2.Refresh
  733.     MList2.ItemForeColor(1) = RGB(255, 255, 255)
  734.     MList2.ItemBkColor(1) = RGB(0, 0, 0)
  735.   End If
  736. End Sub
  737. Sub mnuRemoveItem_Click ()
  738.   MList2.RemoveItem 2
  739. End Sub
  740. Sub mnuRight_Click ()
  741.   MList3.Alignment = 3
  742.   MList3.Refresh
  743. End Sub
  744. Sub mnuSelCount_Click ()
  745.   Dim aString As String
  746.   aString = "MList1.SelCount = " + Str$(MList1.SelCount)
  747.   MsgBox aString, 0, "MList1"
  748. End Sub
  749. Sub mnuSelected_Click ()
  750.   Dim Count As Integer
  751.   Dim X As Integer
  752.   Dim aString As String
  753.   Count = MList1.ListCount
  754.   If MList1.SelCount Then
  755.     For X = 0 To Count - 1
  756.       If MList1.Selected(X) Then
  757.         aString = "True"
  758.       Else
  759.         aString = "False"
  760.       End If
  761.       Debug.Print "Item" + Str$(X) + ": " + aString
  762.     Next
  763.   End If
  764. End Sub
  765. Sub mnuTest_Click ()
  766.   MList2.ImageType = 0
  767.   MList2.ItemLength(1) = 1000
  768.   MList2.ItemLength(2) = 1000
  769.   MList2.ItemLength(3) = 1700
  770.   MList2.ItemLength(4) = 1300
  771.   MList2.SetHzScroll = True
  772. End Sub
  773. Sub mnuText_Click ()
  774.   MsgBox MList2.Text, 0, "MList2"
  775. End Sub
  776. Sub mnuTop_Click ()
  777.   MList3.Alignment = 2
  778.   MList3.Refresh
  779. End Sub
  780. Sub mnuTopIndex_Click ()
  781.   MList2.TopIndex = 6
  782.   Dim aString As String
  783.   aString = "MList2.TopIndex = " + Str$(MList2.TopIndex)
  784.   MsgBox aString, 0, "MList2"
  785. End Sub
  786. Sub mnuUncheckTwo_Click ()
  787.   If MList2.ImageType = 2 Then
  788.     MList2.Checked(2) = False
  789.   End If
  790. End Sub
  791.