home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / mlist_45 / scroll.frm < prev    next >
Text File  |  1994-04-24  |  3KB  |  113 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   1740
  5.    ClientLeft      =   1380
  6.    ClientTop       =   1608
  7.    ClientWidth     =   6036
  8.    Height          =   2160
  9.    Left            =   1332
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1740
  12.    ScaleWidth      =   6036
  13.    Top             =   1236
  14.    Width           =   6132
  15.    Begin PictureBox Picture1 
  16.       BackColor       =   &H00C0C0C0&
  17.       Height          =   204
  18.       Left            =   96
  19.       ScaleHeight     =   180
  20.       ScaleWidth      =   5604
  21.       TabIndex        =   1
  22.       Top             =   96
  23.       Width           =   5628
  24.    End
  25.    Begin MListBox MList1 
  26.       Alignment       =   0  'None
  27.       AllowFocusRect  =   -1  'True
  28.       BorderStyle     =   0  'Normal
  29.       CheckColor      =   &H00000000&
  30.       CheckStyle      =   0  'Cross Style
  31.       DrawRegions     =   5
  32.       EnableVirtualMsgs=   0   'False
  33.       ExtendedSelect  =   0   'False
  34.       FallColor       =   &H00808080&
  35.       FindDirection   =   0  'Forward
  36.       GridColor       =   &H00000000&
  37.       GridStyle       =   0  'Solid
  38.       Height          =   1176
  39.       HiliteBackColor =   &H00000000&
  40.       HiliteForeColor =   &H00000000&
  41.       HorizontalGrids =   0   'False
  42.       ImageRegion     =   0
  43.       ImageType       =   0  'None
  44.       ItemHeight      =   195
  45.       ItemWidth       =   1560
  46.       Left            =   96
  47.       MaskingColor    =   &H00FFFFFF&
  48.       MultiColumn     =   0   'False
  49.       MultiSelect     =   0   'False
  50.       NoIntegralHeight=   0   'False
  51.       OwnerDraw       =   0   'False
  52.       RiseColor       =   &H00FFFFFF&
  53.       SelectMode      =   0  'Normal
  54.       SortColumn      =   0
  55.       Sorted          =   0   'False
  56.       StringCompare   =   0  'Case Sensitive
  57.       TabIndex        =   0
  58.       Top             =   336
  59.       Version         =   "04.20"
  60.       VerticalGrids   =   0   'False
  61.       VirtualMsgZone  =   0
  62.       Width           =   5628
  63.    End
  64. End
  65. Dim scrOffset As Long
  66. Const MM_TWIPS = 6
  67.  
  68. Declare Function TextOut Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal lpString As String, ByVal nCount As Integer) As Integer
  69. Declare Function SetMapMode Lib "GDI" (ByVal hDC As Integer, ByVal nMapMode As Integer) As Integer
  70.  
  71. Sub Form_Load ()
  72.  
  73.   MList1.ItemLength(1) = 2000
  74.   MList1.ItemLength(2) = 2000
  75.   MList1.ItemLength(3) = 2000
  76.   MList1.ItemLength(4) = 2000
  77.   MList1.ItemLength(5) = 2000
  78.  
  79.   MList1.SetHzScroll = 1
  80.  
  81.   For I = 0 To 15
  82.     MList1.AddItem Str$(I) + Chr$(9) + "Value:" + Str$(I) + Chr$(9) + "Information " + Str$(I) + Chr$(9) + "Next To Last" + Chr$(9) + "Last"
  83.   Next I
  84.  
  85. End Sub
  86.  
  87. Sub MList1_DrawItem (ListIndex As Integer, ItemAction As Integer, ItemState As Integer, ItemDC As Integer, ItemLeft As Integer, ItemTop As Integer, ItmeRight As Integer, ItemBottom As Integer, ItemText As String)
  88.  
  89.   retval = TextOut(ItemDC, ItemLeft, ItemTop, ItemText, Len(ItemText))
  90.  
  91. End Sub
  92.  
  93. Sub MList1_ScrollMessage (Offset As Integer)
  94.  
  95.   scrOffset = Offset
  96.   Debug.Print "Scroll offset:" + Str$(scrOffset)
  97.   Picture1.Refresh
  98.  
  99. End Sub
  100.  
  101. Sub Picture1_Paint ()
  102.  
  103.   Dim retval As Integer, Y As Integer
  104.   Y = 0
  105.  
  106.   For I = 1 To 5
  107.     retval = TextOut(Picture1.hDC, -scrOffset + Y, 0, "Column" + Str$(I), 8)
  108.     Y = Y + 165 + I Mod 2
  109.   Next I
  110.  
  111. End Sub
  112.  
  113.