home *** CD-ROM | disk | FTP | other *** search
/ HomeWare 14 / HOMEWARE14.bin / prog / mlst43.arj / READ.ME < prev    next >
Text File  |  1994-04-17  |  32KB  |  805 lines

  1. ***************************************************************************
  2. *
  3. *  McKean Consulting
  4. *  Robin W. McKean
  5. *  1042 Braddock Circle
  6. *  Woodstock GA  30188
  7. *
  8. *  MLIST.VBX    V4.30.0000
  9. *
  10. *  Multi-Purpose List Box Control for Visual Basic 3.0
  11. *
  12. ***************************************************************************
  13.  
  14. MLIST is a custom control for managing the way your data appears in a list
  15. box.  MLIST is a property for property replacement of the standard List Box
  16. control which comes with Visual Basic 3.0.  In addition, there are many more
  17. features which MLIST can do that you can't do with the normal List Box.  Some
  18. of these features are:
  19.  
  20.     * Set up owner draw columnar data in the list box.  This is NOT a
  21.       MULTI-COLUMN list box.  MLIST now has this feature, but the MLIST
  22.       List Box scrolls vertically, like a normal list box.  Your data is
  23.       arranged in columns, with specific drawing flags setup for each
  24.       "Drawing Region".  Think of each line as being broken up into
  25.       different areas, each with its own drawing flags and data.
  26.  
  27.     * Make a drawing region a bitmap or a checkbox.  You have control
  28.       over the entire list's bitmaps through the default bitmap property,
  29.       or you can set individual lines bitmap properties.
  30.  
  31.     * Control individual line colors in the list box
  32.  
  33.     * Total control over the checked and unchecked states of lines
  34.  
  35.     * Now MLIST has aligned bitmaps as well.  You specifiy the bitmap,
  36.       the text, and the alignment (top, bottom, right, left), and MLIST
  37.       will draw the text and the bitmap in the area you define.
  38.  
  39.     * New in verions 4.00.  You can now have true MUTLIPLE COLUMN list
  40.       boxes, with bitmaps and check boxes.  Multiple columns are set
  41.       up through setting the LBS_MULTICOLUMN style for the list box.
  42.       You control the width of each item.  This attribute differs in
  43.       that each line has a certain width.  So it may take two or more
  44.       columns of items to actually fill a line
  45.  
  46.     * Checking and Selecting a range of line items
  47.  
  48.     * Properties to find closest match and find exact matches in the
  49.       list box.
  50.  
  51.     * Complete control over colors in the list box.  Colors can be
  52.       set for normal lines, individual lines, normal highlight colors,
  53.       and individual highlight colors.
  54.  
  55.     * MList V4.10 now has 3-D effects
  56.  
  57.     * You can now setup vertical and horizontal grids
  58.  
  59.     * Virtual List Boxes.  A notification event is sent when more data
  60.       is required by the application.
  61.  
  62.     * Properties to aide you in drag and drop, including identifying
  63.       which line item was dropped upon, and being able to select
  64.       multiple line items before starting a drag
  65.  
  66.     * New ScrollMessage event for drawing column headers over scrolling
  67.       list boxes
  68.  
  69. ***************************************************************************
  70.  
  71. This ZIP file contains:
  72.  
  73.     MLIST.VBX         VB version of the MLIST custom control
  74.     PROJECT1.MAK    Sample project file for MLIST
  75.     FORM1.FRM        Form used by the sample project
  76.     READ.ME            This file
  77.     PLUS.BMP        Bitmap used in example
  78.     PAGE.BMP        Ditto
  79.  
  80.     FINDSTR.MAK        FindString and FindStringExact Demo
  81.     FIND1.FRM        Form for FindString Demo
  82.  
  83.     VIRTUAL.MAK        Virtual List Box example
  84.     VIRTUAL.FRM        Form for virtual list box
  85.  
  86.     SCROLL.MAK        Scrolling column header examples
  87.     SCROLL.FRM        Form for scrolling example
  88.  
  89. ***************************************************************************
  90.  
  91. REGISTRATION
  92.  
  93. Time for the sob story.  This Multi-Column List Box is Shareware.  It is
  94. NOT crippled in anyway.  When you download this custom control, you have
  95. the same custom control that I am using in my everyday VB programming.
  96. As a Shareware contributor, I am counting on the honor and moral fiber of
  97. every person who downloads this custom control to do the right thing.  I
  98. have contributed and participated in the Shareware arena for years now.
  99. Your small contribution can make a difference to me and my family...
  100.  
  101. Right now, the maximum string size in the List Box is 2048 characters.  Let me
  102. know if this causes a problem.  I don't anticipate anyone needing to display
  103. more than this number of characters to the screen.
  104.  
  105. If you like and appreciate this custom control...
  106.  
  107.   1)  Small time developers like me, send $10.00 to the address listed above
  108.   2)  Corporate users send $15.00 to the address listed above
  109.   3)  Register in the Compuserve SWREG forum ID 1585
  110.  
  111. Registered users may purchase the source...
  112.  
  113.   Send $40.00 to me at the above address.
  114.   Register in the SWREG Forum Id 2257.
  115.  
  116.   If you register via CompuServe, the source will be e-mailed to you.  Please
  117.   remember, you may not purchase source unless you are a registered user.
  118.  
  119.   This control is written in C++ and has been compiled using both
  120.   Borland C++ 3.1 and Visual C++ 1.5.
  121.  
  122. You may now register this control in the SWREG on Compuserve.  Type GO SWREG.
  123.  
  124. Corporate users should register via mail or register twice in the SWREG
  125. Forum, as many of you have already done.
  126.  
  127. ***************************************************************************
  128.  
  129. WARRANTY
  130.  
  131. The control, as is, works the way that I want it to.  This does not mean
  132. that it will work the way that you want it to.   Along those lines, I
  133. totally disclaim that the control will do anything whatsoever.  This
  134. includes any implied abilities and any WARRANTIES, including those for
  135. SUITABILITY for a particular purpose, MERCHANTIBILITY, and all that other
  136. bull crap.
  137.  
  138. ***************************************************************************
  139.  
  140. PROGRAMMER'S NOTES (or, what I need to know to use this custom control)
  141.  
  142. The Multi-Column List Box is an enhanced List Box control.  The following
  143. is a desciption of each additional control.  What it does, and how to
  144. use it in your own VB programming.  For additional control properties, see
  145. those properties included in the standard list box control.  MLIST now
  146. contains all standard listbox properties.  The ones listed below are additions.
  147.  
  148. ItemHeight
  149.  
  150. This property is responsible for controlling the height of each individual
  151. line item in the list box.  It defaults to 195 Twips, the height of the
  152. font used by the standard list box.  You should adjust this height if you
  153. change the font, font size, etc..
  154.  
  155. I'm not sure whether or not this property will change the height of the lines
  156. after the list box has already been created.  I did not design the list box
  157. control to have the height of the items change dynamically.  Set the height
  158. of this item at design time, and the font, and your list box will be fine.
  159. Experiment with this during run-time if you like, and let me know how it
  160. works out, and how I can make this item work more to your liking.
  161.  
  162. DrawRegions
  163.  
  164. This item determines the number of drawing regions on each line.  This is
  165. basically equivelent to the number of COLUMNS, but this list box will still
  166. scroll like a normal list box.  When setting this property, the control
  167. clears the flags for the draw regions and sets them to left aligned, single
  168. line, and centered vertically.  Consult the Windows API for DrawText to
  169. see what exactly these flags mean.
  170.  
  171. ItemLength
  172.  
  173. This is an indexed property which corresponds to the length of each drawing
  174. region.  If you want a drawing region to be a specific length, set that
  175. drawing region's length to the desired setting in twips.  For example...
  176.  
  177.     MList1.DrawRegions = 2
  178.     MList.ItemLength(1) = 500
  179.     MList.ItemLength(2) = 500
  180.  
  181.     ' Generates an out of index error
  182.     MList1.ItemLength(0) = XXX
  183.     MList1.ItemLength(3) = XXX
  184.  
  185. It is probably a good idea to set the lengths of all drawing regions when you
  186. are changing the defaults.
  187.  
  188. DrawFlags
  189.  
  190. This is an indexed property which corresponds to the flags of each drawing
  191. region.  If you want a drawing region to be drawn in a specific manner, set
  192. that drawing region's flags to the desired settings.  For specific flags,
  193. look up the DrawText API function in the Windows API Reference.  In the
  194. following example, I setup two drawing regions and set the second drawing
  195. region's flags to right justify the text.  In this example, the second
  196. drawing region displays currency values.
  197.  
  198.     Const DT_RIGHT = 2
  199.     Const DT_VCENTER = 4
  200.     Const DT_SINGLELINE = 32
  201.  
  202.     MList1.DrawRegions = 2
  203.     MList1.DrawFlags(2) = DT_RIGHT + DT_VCENTER + DT_SINGLELINE
  204.     MList.ItemLength(1) = 500
  205.     MList.ItemLength(2) = 500
  206.  
  207. If you are planning to include the '&' character in your strings, you
  208. should include the DT_NOPREFIX flag to avoid the underline.  I do NOT
  209. automatically add this flag for you, as I want you to have total control
  210. over the flags.
  211.  
  212. ActiveRegion
  213.  
  214. Setting this property affects the next two properties.  It defines the
  215. DrawingRegion (or index or column) that TextRegion and ListRegion will
  216. return.  Perhaps an example is in order.
  217.  
  218. My list box is divided up into three columns, name, account number, dollar
  219. amount.  I want to get the account number for the currently selected line
  220. as well as the first item...
  221.  
  222.     MList1.ActiveRegion = 2
  223.     aString$ = MList1.TextRegion    ' Gets 2nd column of current text
  224.     bString$ = MList1.ListRegion(0)    ' 2nd column of item at index 0
  225.  
  226. TextRegion
  227.  
  228. This property will return the ActiveRegion in the currently selected text.
  229. See the above "ActiveRegion".  Corresponds to a DrawRegion of the Text property.
  230. These values can also be written to at run time.
  231.  
  232. ListRegion
  233.  
  234. This property will return the ActiveRegion in the item at the specific index.
  235. See the above "ActiveRegion".  Corresponds to a DrawRegion of the List property.
  236. These values can also be written to at run time.
  237.  
  238. DefPicture
  239.  
  240. This is the default bitmap to be displayed in the ImageRegion when a specific
  241. bitmap has not been assigned to that items ItemPicture property.  Please see
  242. the demo on setting your own default picture and ItemPicture properties.
  243.  
  244. ImageType
  245.  
  246. This determines what type of image we are dealing with in our image region.
  247. If this property is set to 0, then the ImageRegion property is ignored and
  248. only text is dislayed.  If this image type is valid, then a checkbox or
  249. bitmap is displayed in the ImageRegion.
  250.  
  251. Note that when the image type is set to AlignBitmap, the normal drawing
  252. regions no longer apply.  Anybody got a problem with that???
  253.  
  254. ImageRegion
  255.  
  256. This property specifies which region contains the image region.  This value
  257. should be any number between 1 and the number of DrawRegions.  You may not
  258. set this property to a value of less than zero or greater then DrawRegions.
  259. When setting up your DrawRegions, the following is a good example:
  260.  
  261.     MList1.DrawRegions = 3
  262.     MList1.ImageRegion = 1
  263.  
  264.     MList1.ItemLength(1) = 100        ' Bitmap is in here
  265.     MList1.ItemLength(2) = 500
  266.     MList1.ItemLength(3) = 750
  267.  
  268.     ' Don't leave a space for the ImageRegion in your strings
  269.     MList1.AddItem "Region2" + Chr$(9) + "Region3"
  270.     MList1.AddItem "Region22" + Chr$(9) + "Region33"
  271.  
  272. The ImageRegion is ignored when calculating the "piece" of text that goes in
  273. that region.
  274.  
  275. Checked
  276.  
  277. This property is very similar to the Selected property.  In a Multi-Column
  278. list box with the ImageType set 2 (CheckBox), this property will return to
  279. you whether or not that line item is checked or not.  For example:
  280.  
  281.     For X% = 0 To MList1.ListCount - 1
  282.  
  283.         If MList1.Checked(X%) Then
  284.             Debug.Print "I am Checked! "; X%
  285.         Else
  286.             Debug.Print "I am not checked! "; X%
  287.         End If
  288.     Next X%
  289.  
  290.     ' Check the first item
  291.     MList1.Checked(0) = True
  292.  
  293. ItemPicture
  294.  
  295. This property is an array of pictures which correspond to the bitmaps for
  296. each line item in the list box.  If this item is not set by you, then
  297. the MList uses the DefPicture property.
  298.  
  299.     ' Change the first items picture in the list box
  300.     MList1.ItemPicture(0) = Image1.Picture
  301.  
  302. ItemForeColor
  303.  
  304. This property is an array of color which correspond to the foreground color
  305. for each line item in the list box.  If this item is not set by you, then
  306. the MList uses the default foreground color property.
  307.  
  308.     ' Change the first items foreground color to white
  309.     MList1.ItemForeColor(0) = RGB(255,255,255)
  310.  
  311. ItemBkColor
  312.  
  313. This property is an array of color which correspond to the background color
  314. for each line item in the list box.  If this item is not set by you, then
  315. the MList uses the default background color property.
  316.  
  317.     ' Change the first items background color to black
  318.     MList1.ItemBkColor(0) = RGB(0,0,0)
  319.  
  320. Alignment
  321.  
  322. This property controls the placement of the bitmap when the image type is
  323. set to 4, AlignBitmap.  See the demo for details, but basically the values
  324. for this property are:
  325.  
  326. 1 - Align the bitmap to the left, centered, then the text, centered
  327.     vertically and left justified.
  328. 2 -    Align the bitmap on top, centered, then the text, centered
  329.     horizontally and vertically.
  330. 3 - Align the bitmap to the right, centered, then the text, centered
  331.     vertically and left justified.
  332. 4 -    Align the bitmap on bottom, centered, then the text, centered
  333.     horizontally and vertically.
  334.  
  335. Note that when the image type is set to AlignBitmap, the normal drawing
  336. regions no longer apply.  Anybody got a problem with that???
  337.  
  338. MultiColumn
  339.  
  340. This turns the list box into a true multiple column list box.  The list box
  341. will scroll horizontal instead of vertical.  A default item width is provided,
  342. but you, the developer, should override this property.  This property should
  343. be set to true for multi-column, or false (the default) for normal list box
  344. behavior.
  345.  
  346. ItemWidth
  347.  
  348. The property specifies the width of each line in a multiple column list box.
  349. The width is set in Twips.  The normal drawing regions still apply, but I
  350. can't think of a reason why someone would want to divide line items in a
  351. column list box into more columns.
  352.  
  353. FindString
  354.  
  355. Setting this property will cause the list box to search for a string with
  356. the closest match from the current ListIndex.  If one is found, that string
  357. is set to the current ListIndex.  This is useful for moving items through
  358. a list box while typing the string in an edit control, ie.  Search in Help.
  359.  
  360. FindStringExact
  361.  
  362. This property is the same as above, except that it will search for an exact
  363. match.
  364.  
  365. RangeStart
  366.  
  367. This property marks the beginning line item for RangeSelected or RangeChecked.
  368. The offset is 0 based, so the first item is 0.
  369.  
  370. RangeEnd
  371.  
  372. This property marks the ending line item for RangeSelected or RangeChecked.
  373.  
  374. RangeSelected
  375.  
  376. All items in the range RangeStart to RangeEnd are marked as selected in the
  377. list box.  If the list box is not multi-select, then this is ignored.
  378.  
  379.     MList1.RangeStart = 0
  380.     MList1.RangeEnd = 3
  381.     MList1.RangeSelected = True
  382.  
  383. RangeChecked
  384.  
  385. All items in the range RangeStart to RangeEnd are marked as checked in the
  386. list box.
  387.  
  388.     MList1.RangeStart = 0
  389.     MList1.RangeEnd = 3
  390.     MList1.RangeChecked = False
  391.  
  392. SetHzScroll
  393.  
  394. When all is said and done, and you are through setting up your list box, and
  395. your columns extend past the displayable area of the list box, setting this
  396. property to True will cause the MLIST control to add up all of the drawing
  397. regions and add a horizontal scroll bar to the list box if one is neccessary.
  398.  
  399.  
  400. HiliteForeColor,
  401.  
  402. This is the default foreground color to use when a line in the list box is
  403. hilited.  If these colors are set, then the normal colors are ignored, and
  404. the HiliteForeColor is used to draw the text, and HiliteBackColor is used
  405. to draw the background.
  406.  
  407. You may force MList to use the default colors by setting this color equal
  408. HiliteBackColor.
  409.  
  410. HiliteBackColor,
  411.  
  412. This is the default background color to use when a line in the list box is
  413. hilited.  If these colors are set, then the normal colors are ignored, and
  414. the HiliteForeColor is used to draw the text, and HiliteBackColor is used
  415. to draw the background.
  416.  
  417. You may force MList to use the default colors by setting this color equal
  418. HiliteForeColor.
  419.  
  420. ItemHiliteForeColor,
  421.  
  422. This is a property array, which corresponds to each line item in the list box.
  423. Using this property, you can set the foreground and background hilited color
  424. of individual line items.
  425.  
  426.     MList1.ItemHiliteForeColor(0) = RGB(0,0,0)
  427.     MList1.ItemHiliteBackColor(0) = RGB(255,255,255)
  428.  
  429. ItemHiliteBackColor,
  430.  
  431. This is a property array, which corresponds to each line item in the list box.
  432. Using this property, you can set the foreground and background hilited color
  433. of individual line items.
  434.  
  435.     MList1.ItemHiliteForeColor(0) = RGB(0,0,0)
  436.     MList1.ItemHiliteBackColor(0) = RGB(255,255,255)
  437.  
  438. MaskingColor
  439.  
  440. This color is used to mask out colors in your bitmaps when they are included
  441. in your MList Box.  For example, lets say that you know you are not going
  442. to use the color white in your bitmaps or list boxes, so, you can set all the
  443. pixels in your bitmap, which you want to be transparent to white, and the
  444. natural color of the list box will show through your bitmap wherever the color
  445. white is.  Think of this as the transparent color, like in Icons, except you
  446. get to determine what it is.
  447.  
  448. HorizontalGrids
  449.  
  450. Set this property to true, if you want to allow horizontal grid lines to be
  451. drawn on your list box.
  452.  
  453. VerticalGrids
  454.  
  455. Set this property to true, if you want to allow vertical grid lines to be
  456. drawn on your list box.
  457.  
  458. GridStyle
  459.  
  460. This determines what line style is used to draw the grid lines.  This didn't
  461. quite turn out the way I wanted, but experiment if you like, and give me
  462. some suggestions.
  463.  
  464. BorderStyle
  465.  
  466. This property controls the border style of the list box.  Valid values are normal,
  467. raised, and inset.
  468.  
  469. RiseColor
  470.  
  471. This is the color of the rising edge of a 3-D list box.  Default color is white.
  472.  
  473. FallColor
  474.  
  475. This is the color of the falling edge of the 3-D list box.  The default color
  476. is a dark grey color.
  477.  
  478. Version
  479.  
  480. This property was included by me to insure backwards compatibility.  You don't
  481. need to be concerned with its use, as I use it for different things.
  482.  
  483. ExtendedSelect
  484.  
  485. This property will allow multiple select list boxes to be accessed via
  486. extended selection.  This causes the listbox to be created with the
  487. LBS_EXENDEDSEL style.  See the MS-Windows SDK help for more on extended
  488. select.
  489.  
  490. GridColor
  491.  
  492. This property determines the color of the horizontal and vertical grids.
  493. The default color is black.  I prefer light grey.
  494.  
  495. FindDirection
  496.  
  497. This property now determines which direction a FindString and
  498. FindStringExact will search the list.  If set to 0, the search will
  499. begin at the currently active ListIndex and search to the bottom of
  500. the list.  If set to one, MList will begin at the current ListIndex
  501. and search to the top of the list.
  502.  
  503. EnableVirtualMsgs
  504.  
  505. This property enables virtual messages.  Setting this property to True
  506. causes a message to be sent to the VirtualMessage event whenever the
  507. user approaches the beginning or end of the list.  These messages are
  508. sent whether caused by a mouse or keyboard event.  See VirtualMessage
  509. event for details.
  510.  
  511. VirtualMsgZone
  512.  
  513. This property determines when a virtual message event is sent.  This
  514. property indicates then "zone" at the beggining and end of the list
  515. that triggers the event.  For example, setting this property to 100,
  516. would cause a VIRTUAL_END event to be sent to VirtualMessage when the
  517. user got within a 100 lines of the end of the list box, and a
  518. VIRTUAL_BEGIN event when the user gets within 100 lines of the begging
  519. of the list box.  The event is only triggered if the user is heading
  520. towards the respective end of the list box.
  521.  
  522. CheckStyle
  523.  
  524. This property deterines the type of "checkbox" displayed by a checkbox
  525. style MList.  When this property is set to 0, the normal "cross/diagonal"
  526. check box is used.  When set to one, a check mark is placed in the box
  527. instead.
  528.  
  529. CheckColor
  530.  
  531. This property determines the color of the check mark.
  532.  
  533. SortColumn
  534.  
  535. When using the DrawRegions property, this property can be used to determine
  536. which piece of your string determines the sort order.  For example:
  537.  
  538.     MList1.DrawRegions = 2
  539.     MList1.SortColumn = 2
  540.     MList1.AddItem "100" + Chr$(9) + "High"
  541.     Mlist1.AddItem "101" + Chr$(9) + "Critical"
  542.  
  543. This example would sort the list box by priority.  Only strings added after
  544. this property is set will be affected.  If this property is changed after
  545. the strings are added, you will have to remove all the strings and then re-add
  546. them.  I thought about doing this myself, but the issues over preserving
  547. pictures, drawing info, and all that other stuff made it a little more difficult
  548. than I care to tackle at this moment.
  549.  
  550. Setting this property to 0 sorts based on the entire string.
  551.  
  552. SelectMode
  553.  
  554. This property will help you when you want to drag and drop with a mutli-select/
  555. extended select list box.  When using the normal extended select/multi-select
  556. list box, after selecting X number of items, if you select a hilited item with
  557. the mouse, all the other items are de-selected.  This is a problem when trying
  558. to drag and drop multiple items from the list.  Setting this property to 1
  559. (Drag and Drop) causes the left mouse click to "Ignored" when the item begin
  560. selected is already hilited.  This allows the user to start the drag (MouseMove),
  561. and you, the developer, can then set MList1.Drag 1, so dragging can begin.  If the
  562. user releases the drag over the same list box, nothing changes.  If the user moves
  563. over other controls, you will get the appropriate messages.
  564.  
  565. Clicking on a hilited item, and not moving the mouse, then releasing the mouse over
  566. the same spot, will de-select all other items in the list box, except for the one
  567. over which the mouse was released.
  568.  
  569. All in all, this property causes MList to behave like the File Manager program which
  570. comes with Windows.  See the Demo and File Manager for examples of the behavior.
  571.  
  572. ItemX
  573.  
  574. This property is available only at run time.  You may set this property in conjunction
  575. with ItemY to determine which item in the list is currently under mouse events.
  576.  
  577. ItemY
  578.  
  579. This property is available only at run time.  You may set this property in conjunction
  580. with ItemX to determine which item in the list is currently under mouse events.
  581.  
  582. Item
  583.  
  584. This property returns the Index of the string at ItemX and ItemY.  Here is
  585. an example that determines over which item a control was dropped:
  586.  
  587.     Sub MList1_DragDrop (Source As Control, X As Single, Y As Single)
  588.  
  589.         MList1.ItemX = X
  590.         MList1.ItemY = Y
  591.  
  592.         Debug.Print "Control was dropped over item at Index";Str$(MList1.Item)
  593.  
  594.     End Sub
  595.  
  596. This property starts the search at TopIndex, since it assumes that the
  597. item you are looking for is currently displayed in the list box.
  598.  
  599. StringCompare
  600.  
  601. This property determines whether compares are case sensitive or case
  602. insensitive.  This only affects the compare when determining placement
  603. in a Sorted list box.  This does not affect FindString and FindStringExact
  604. properties.
  605.  
  606. Resort
  607.  
  608. Setting this property to 1 causes the list box to resort itself, provided 
  609. of course that it is a sorted list box.  Additionally, the sort may fail 
  610. if there is not enough disk space for resorting.
  611.  
  612. ***************************************************************************
  613.  
  614. New Events
  615.  
  616. SelChange()
  617.  
  618. This event is called whenever a selection in the list box is changed
  619. either through the keyboard or the mouse.  You might want to use the
  620. event instead of or in addition to the Click method if you want to
  621. respond to selection changes when the user use the arrow keys instead
  622. of the mouse.
  623.  
  624. SelCheck(Index As Integer, State As Integer)
  625.  
  626. This event is called whenever the checked status of a line in the list
  627. box is changed.  The first parameter to this event is the Index
  628. (line item) that has been effected.  The second parameter is the state
  629. of the checked box.  It is either True or False.
  630.  
  631. VirtualMessage(Message As Integer)
  632.  
  633. This is my first attempt at a virtual list box, so please don't laugh.
  634. I am basically providing the means by which to notify you when more
  635. data is needed.  For now, you will have to keep track of your own data.
  636.  
  637. The following Message(s) are sent to this event:
  638.  
  639.  
  640.     VIRTUAL_UP  - This should be defined as having a value of (1).  This
  641.     message will be sent when you need to add items to the end of the
  642.     list, because it is scrolling up.
  643.  
  644.     VIRTUAL_DOWN - This should be defined as having a value of (2).  This
  645.     message will be sent when you need to add items to the beginning of
  646.     the list, because it is scrolling down.
  647.  
  648.     VIRTUAL_END    - This is sent when the user is moving to the end of the
  649.     list.  You should load whatever number of lines you need to, then
  650.     MList will position ListIndex to the end of the list.  This item should
  651.     be defined as (3).
  652.  
  653.     VIRTUAL_HOME - This is sent when the user is moving to the beginning of
  654.     the list.  You should load whatever number of lines you need to, then
  655.     MList will position ListIndex to the start of the list.  This item should
  656.     be defined as (4).
  657.  
  658. MList will move the current ListIndex as Items are added to and removed from
  659. the list.  You should try to cache all the items you will load in memory, then
  660. add them to the list at one time.  Save off TopIndex and ListIndex, so that
  661. you can restore them.  You will need to subtract or add the number of new
  662. items loaded (and removed) depending on which direction you are moving in.
  663. See the example for details.
  664.  
  665. There are no properties like VirtualListIndex, VirtualTopIndex, VirtualCount,
  666. etc.  I am thinking hard about these, and hope to come up with an elegant
  667. solution.  Any suggestions???
  668.  
  669. I guess what I have done is provide virtual capabilities while leaving most
  670. of the implementation in your court.
  671.  
  672. ScrollMessage(Offset As Index)
  673.  
  674. This function is called when the list box is scrolling **HORIZONTALLY**.
  675. This allows you to scroll your own column headers over the list box.  
  676. Offset is the number of **PIXELS** the window has been scrolled.  See
  677. the scroll demo for details.
  678.  
  679. Unforunately, due to Twips To Pixels and vis a vis, there is no exact
  680. relation between the number of pixels and the number of twips.  If you
  681. look at the example, you'll see that the more columns the right you go,
  682. the further off the column header is.  This can be solved manually placing
  683. each one to start with.  Once this is done, just copy the code and go!
  684.  
  685. ***************************************************************************
  686.  
  687. FORMATTING STRINGS
  688.  
  689. You should place the Tab character between each column in your string.  The
  690. following example formats a string for the DrawFlags example:
  691.  
  692.     MList1.AddItem "Robin W. McKean" + Chr$(9) + "$100.00"
  693.  
  694. The following string is for three columns:
  695.  
  696.     MList1.AddItem "Robin W. McKean"+Chr$(9)+"$100.00"+Chr$(9)+"True"
  697.  
  698. Remember, you do NOT have to include a column for the ImageRegion.  If
  699. the ImageRegion property was 1 and the DrawRegions property was 3, then
  700. the following line would work fine (3-1=2)
  701.  
  702.     MList1.AddItem "Robin W. McKean"+Chr$(9)+"$100.00"
  703.  
  704. ***************************************************************************
  705.  
  706. REACHING THE AUTHOR
  707.  
  708. I can be reached via U.S. Mail at the address listed above.  You can reach
  709. me via E-Mail at the following locations...
  710.  
  711. Compuserve:            Robin W. McKean
  712.                     72622,1403
  713.  
  714. Shareware South:    Robin W. McKean
  715.                     Atlanta, GA
  716.  
  717. I'm on CompuServe once or twice a day.  I check Shareware South about once
  718. a week.
  719.  
  720. ***************************************************************************
  721.  
  722. REVISION HISTORY
  723.  
  724. 3.00.0000    Initial release of the MLIST.VBX Custom Control
  725. 3.01.0000    Fixed "Bad Index" error message when setting Selected
  726.             property to True|False.
  727.             Added ItemData property to control.
  728.             Added ListIndex property to control.
  729.             Fixed an apparent bug in the VB API that was passing right
  730.             mouse button clicks to the Click event, but not the left
  731.             mouse button.
  732. 3.02.0000    Fixed a ton of problems.  Namely, the page down didn't work.
  733.             Delete current controls and rebuild to fix this problem.
  734.             Added ALL default controls for the standard list box.
  735.             Tested all of them before uploading.
  736. 3.03.0000    Fixed the index problem with the List property.  If anything,
  737.             I am guilty of being over enthusiastic.  I apologize to those
  738.             who got the previous version and thought it sucked.  Probably
  739.             because it did.  I added bitmaps and checkboxes as well as
  740.             the ability to change the color of a specific line.  You can
  741.             also change the bitmap of a specific line item.
  742. 3.04.0000    Fixed the bug with setting the Checked property, and then not
  743.             having the user be able to double click it or click the box
  744.             to change it back.  Added the AlignBitmap image type and
  745.             the Alignment property.
  746. 4.00.0000    Added the Multicolumn property and item width.  Added the
  747.             FindString and FindStringExact properties for searching
  748.             the list box.  Added the range properties for checking
  749.             and selecting multiple line items.
  750. 4.01.0000    Removed the 64k limit.  MLIST will now allow more than 64k
  751.             worth of data to be added to it.  Also, quit handling default
  752.             methods, such as Move (which didn't work), Refresh, and others.
  753.             Fixed problem with RemoveItem not deleting lines data.
  754.             Changing the way MLIST handled strings did the job.
  755. 4.02.0000    Removed a bug which caused a GP fault when more than 16 drawing
  756.             regions were requested by the user.  Reworked VB2.0 compatibility
  757.             strategy.
  758. 4.10.0000    Added 3-D, rise and fall colors, and SelChange event.
  759. 4.11.0000    Hilighted lines will default to the system colors as controlled
  760.             by the control panel.  User may still override useing the
  761.             HiliteForeColor and HiliteBackColor.  Added the ExtendedSelect
  762.             property.
  763. 4.20.0000    Tightened up the difference between a multi-select list box
  764.             and a normal list box.  I added grid color, virtual messages,
  765.             check marks in check boxes, SelChange events when ListIndex is
  766.             changed, SelCheck for when an item is checked/unchecked.
  767. 4.30.0000    Changed the way that virtual list boxes determine when they are
  768.             in the virtual region.  I used to use the TopIndex property,
  769.             now I use the thumb position on the scroll bar.
  770.             Added new properties for SortColumn and StringCompare.  These
  771.             properties allow you sort on different columns as well as
  772.             determine if the strings are case sensitive/insensitive.
  773.             Added new properties for Drag and Drop.  The first, SelectedMode,
  774.             doesn't allow items to become "de-selected" when dragging.  ItemX,
  775.             ItemY, and Item help you determine which line item is being
  776.             dragged over/dropped upon.  Fixed dynamic loading of an MList, and
  777.             calling AddItem "MyString", 0 when there are no items in the list.
  778.             Added ScrollMessage for scrolling column headers.
  779.  
  780. ***************************************************************************
  781.  
  782. ACKNOWLEDGEMENTS
  783.  
  784. I would like to thank Simon, Kevin, and Neil for their input.  A great C++
  785. programmer does not a good VB programmer make...  Please, Please, Please,
  786. take a few minutes to notify me if there are any bugs.  I hate bugs...
  787.  
  788. Thanks to Paul for the check box problem.
  789.  
  790. Thanks to Alex for providing info on VB 2.0 problems.
  791.  
  792. Thanks to Michael and David for color problems with hilighted text.
  793.  
  794. Thanks to Michael for extended select reminder.
  795.  
  796. Thanks to Stacy, Juha, Darren and Paul, who all made a big difference in
  797. the quality of this release.
  798.  
  799. Thanks to Robert, for the ideas on improving Drag and Drop and the 
  800. scrolling column header suggestions.
  801.  
  802. Thanks to Alexander for the Load problem.
  803.  
  804. ***************************************************************************
  805.