home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / code_lib / objlibr / objlib12 / sample2 / listwin.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-06-05  |  2.7 KB  |  108 lines

  1. VERSION 2.00
  2. Begin Form ListWindow 
  3.    Caption         =   "ListWindow"
  4.    ClientHeight    =   4935
  5.    ClientLeft      =   3375
  6.    ClientTop       =   885
  7.    ClientWidth     =   3300
  8.    FontBold        =   0   'False
  9.    FontItalic      =   0   'False
  10.    FontName        =   "MS Sans Serif"
  11.    FontSize        =   8.25
  12.    FontStrikethru  =   0   'False
  13.    FontUnderline   =   0   'False
  14.    Height          =   5340
  15.    Icon            =   LISTWIN.FRX:0000
  16.    Left            =   3315
  17.    LinkTopic       =   "Form1"
  18.    ScaleHeight     =   329
  19.    ScaleMode       =   3  'Pixel
  20.    ScaleWidth      =   220
  21.    Top             =   540
  22.    Width           =   3420
  23.    Begin VScrollBar vs 
  24.       Height          =   2772
  25.       LargeChange     =   2
  26.       Left            =   3025
  27.       Max             =   2
  28.       TabIndex        =   1
  29.       Top             =   0
  30.       Width           =   264
  31.    End
  32.    Begin PictureBox pics 
  33.       AutoRedraw      =   -1  'True
  34.       BackColor       =   &H00FFFFFF&
  35.       BorderStyle     =   0  'None
  36.       Height          =   480
  37.       Left            =   30
  38.       ScaleHeight     =   32
  39.       ScaleMode       =   3  'Pixel
  40.       ScaleWidth      =   307
  41.       TabIndex        =   0
  42.       Top             =   150
  43.       Visible         =   0   'False
  44.       Width           =   4609
  45.    End
  46. Option Explicit
  47. DefInt A-Z
  48. Dim loading%
  49. 'structure holding the data for
  50. 'for this window's listbox
  51. Dim ld As LISTDATA
  52. 'this array holds the items in the list
  53. Dim items() As ITEMDATA
  54. Sub Form_DblClick ()
  55. Dim res%
  56. Dim item As ITEMDATA
  57. screen.MousePointer = 11
  58. res = launch(Me, items(ld.active))
  59. DoEvents
  60. screen.MousePointer = 0
  61. 'successful launch?
  62. If res = -1 Then
  63.     Unload Me
  64.     Show
  65. End If
  66. End Sub
  67. Sub Form_Load ()
  68. loading = -1
  69. InitList Me, ld
  70. caption = gItem.cap
  71. GetPMItems CStr(caption), ld, items()
  72. LoadIcons Me, ld, items()
  73. loading = 0
  74. End Sub
  75. Sub Form_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
  76. ItemClick Me, ld, items(), y
  77. End Sub
  78. Sub Form_Paint ()
  79. Debug.Print "Paint"
  80. If Not loading% Then
  81.     Cls
  82.     'get system colors and redraw bitmaps if necessary
  83.     SetColor
  84.     If backcolor <> cdata.bkg Then
  85.         LoadIcons Me, ld, items()
  86.         backcolor = cdata.bkg
  87.     End If
  88.     forecolor = cdata.txt
  89.     'repaint client area
  90.     PaintList Me, ld, items()
  91. End If
  92. End Sub
  93. Sub Form_Resize ()
  94. ResizeList Me, ld
  95. End Sub
  96. Sub Form_Unload (Cancel As Integer)
  97. Dim r%
  98. r = LoadListWindow(CStr(caption), Val(Tag))
  99. End Sub
  100. Sub vs_Change ()
  101. Dim n%
  102. n = (vs.Value)
  103. 'Debug.Print "toprow=" & n
  104. 'toprow range: 0=1st row,1=2nd, etc
  105. ld.toprow = n
  106. Form_Paint
  107. End Sub
  108.