home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / OPTIMIZE / FRMPICS.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-16  |  5.4 KB  |  170 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
  3. Begin VB.Form Pictures 
  4.    AutoRedraw      =   -1  'True
  5.    Caption         =   "Picture vs. Image Controls"
  6.    ClientHeight    =   3495
  7.    ClientLeft      =   2100
  8.    ClientTop       =   2085
  9.    ClientWidth     =   6390
  10.    BeginProperty Font 
  11.       Name            =   "MS Sans Serif"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    LinkTopic       =   "Form4"
  21.    PaletteMode     =   1  'UseZOrder
  22.    ScaleHeight     =   233
  23.    ScaleMode       =   3  'Pixel
  24.    ScaleWidth      =   426
  25.    Tag             =   "Display"
  26.    WhatsThisHelp   =   -1  'True
  27.    Begin VB.PictureBox Picture1 
  28.       Appearance      =   0  'Flat
  29.       AutoRedraw      =   -1  'True
  30.       AutoSize        =   -1  'True
  31.       BackColor       =   &H80000005&
  32.       ForeColor       =   &H80000008&
  33.       Height          =   2280
  34.       Index           =   0
  35.       Left            =   3240
  36.       Picture         =   "FRMPICS.frx":0000
  37.       ScaleHeight     =   2250
  38.       ScaleWidth      =   3000
  39.       TabIndex        =   0
  40.       Top             =   480
  41.       Width           =   3030
  42.    End
  43.    Begin ComctlLib.StatusBar sbStatus 
  44.       Align           =   2  'Align Bottom
  45.       Height          =   285
  46.       Left            =   0
  47.       TabIndex        =   1
  48.       Top             =   3210
  49.       Width           =   6390
  50.       _ExtentX        =   11271
  51.       _ExtentY        =   503
  52.       Style           =   1
  53.       SimpleText      =   ""
  54.       BeginProperty Panels {2C787A51-E01C-11CF-8E74-00A0C90F26F8} 
  55.          NumPanels       =   1
  56.          BeginProperty Panel1 {2C787A53-E01C-11CF-8E74-00A0C90F26F8} 
  57.             AutoSize        =   1
  58.             Object.Width           =   10780
  59.             TextSave        =   ""
  60.             Key             =   ""
  61.             Object.Tag             =   ""
  62.          EndProperty
  63.       EndProperty
  64.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  65.          Name            =   "MS Sans Serif"
  66.          Size            =   8.25
  67.          Charset         =   0
  68.          Weight          =   400
  69.          Underline       =   0   'False
  70.          Italic          =   0   'False
  71.          Strikethrough   =   0   'False
  72.       EndProperty
  73.       MouseIcon       =   "FRMPICS.frx":7972
  74.    End
  75.    Begin VB.Label Label3 
  76.       Caption         =   "Click on the images to test resource usage"
  77.       Height          =   255
  78.       Left            =   1320
  79.       TabIndex        =   4
  80.       Top             =   2880
  81.       Width           =   3735
  82.    End
  83.    Begin VB.Label Label2 
  84.       Caption         =   "PictureBox control"
  85.       Height          =   375
  86.       Left            =   3840
  87.       TabIndex        =   3
  88.       Top             =   120
  89.       Width           =   1935
  90.    End
  91.    Begin VB.Label Label1 
  92.       Caption         =   "Image control"
  93.       Height          =   255
  94.       Left            =   840
  95.       TabIndex        =   2
  96.       Top             =   120
  97.       Width           =   2055
  98.    End
  99.    Begin VB.Image Image1 
  100.       Appearance      =   0  'Flat
  101.       Height          =   2250
  102.       Index           =   0
  103.       Left            =   120
  104.       Picture         =   "FRMPICS.frx":798E
  105.       Top             =   480
  106.       Width           =   3000
  107.    End
  108. Attribute VB_Name = "Pictures"
  109. Attribute VB_GlobalNameSpace = False
  110. Attribute VB_Creatable = False
  111. Attribute VB_TemplateDerived = False
  112. Attribute VB_PredeclaredId = True
  113. Attribute VB_Exposed = False
  114. Private Sub Form_Load()
  115.   PosForm Me
  116. End Sub
  117. Private Sub Form_Unload(Cancel As Integer)
  118.     Set frmPics = Nothing
  119. End Sub
  120. Private Sub Image1_Click(Index As Integer)
  121.   On Error Resume Next
  122.   Dim i As Integer, j As Integer
  123.   Screen.MousePointer = vbHourglass
  124.     i = 1
  125.     Do
  126.         Load Image1(i)
  127.         Image1(i).Move Image1(i - 1).Left + 4, Image1(i - 1).TOP + 4
  128.         Image1(i).Visible = True
  129.         i = i + 1
  130.         If i Mod 20 = 0 Then
  131.           sbStatus.SimpleText = Str$(i) & " Image Controls"
  132.           DoEvents
  133.         End If
  134.     Loop Until Err Or i = 5000
  135.     For j = i To 1 Step -1
  136.         Unload Image1(i)
  137.         Set Image1(i) = Nothing
  138.     Next j
  139.     frmPictures.Refresh
  140.     frmExplore.Refresh
  141.     MsgBox "Allocated " & Str$(i) & " Image Controls", vbInformation, "Image Control"
  142.     Screen.MousePointer = vbDefault
  143. End Sub
  144. Private Sub Picture1_Click(Index As Integer)
  145. On Error Resume Next
  146. Dim i As Integer, j As Integer
  147.     i = 1
  148.     Screen.MousePointer = vbHourglass
  149.     Do
  150.         Load Picture1(i)
  151.         Picture1(i).Move Picture1(i - 1).Left + 4, Picture1(i - 1).TOP + 4
  152.         Picture1(i).Visible = True
  153.         If i Mod 20 = 0 Then
  154.           sbStatus.SimpleText = Str$(i) & " Picture Controls"
  155.           sbStatus.Refresh
  156.         End If
  157.         i = i + 1
  158.     Loop Until Err
  159.     sbStatus.SimpleText = Str$(i) & " Picture Controls"
  160.     sbStatus.Refresh
  161.     For j = i To 1 Step -1
  162.         Unload Picture1(i)
  163.         Set Picture1(i) = Nothing
  164.     Next j
  165.     frmPictures.Refresh
  166.     frmExplore.Refresh
  167.     Screen.MousePointer = vbDefault
  168.     MsgBox "Allocated " & Str$(i) & " Picture Controls", vbInformation, "Picture Controls"
  169. End Sub
  170.