home *** CD-ROM | disk | FTP | other *** search
/ Prima Shareware 3 / DuCom_Prima-Shareware-3_cd1.bin / PROGRAMO / VB40 / COMPACT / DEMO.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-01-18  |  4.1 KB  |  143 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Compression Demo"
  4.    ClientHeight    =   4725
  5.    ClientLeft      =   1560
  6.    ClientTop       =   1800
  7.    ClientWidth     =   6705
  8.    Height          =   5130
  9.    Left            =   1500
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4725
  12.    ScaleWidth      =   6705
  13.    Top             =   1455
  14.    Width           =   6825
  15.    Begin VB.TextBox Text2 
  16.       Height          =   285
  17.       Left            =   3000
  18.       TabIndex        =   6
  19.       Text            =   "NewFile"
  20.       Top             =   4320
  21.       Width           =   2295
  22.    End
  23.    Begin VB.CommandButton Command2 
  24.       Caption         =   "Uncompress"
  25.       Height          =   255
  26.       Left            =   5400
  27.       TabIndex        =   5
  28.       Top             =   4320
  29.       Width           =   1215
  30.    End
  31.    Begin VB.CommandButton Command1 
  32.       Caption         =   "Compress"
  33.       Height          =   255
  34.       Left            =   5400
  35.       TabIndex        =   4
  36.       Top             =   4020
  37.       Width           =   1215
  38.    End
  39.    Begin VB.TextBox Text1 
  40.       Height          =   285
  41.       Left            =   3000
  42.       TabIndex        =   3
  43.       Text            =   "Compact.cmp"
  44.       Top             =   3960
  45.       Width           =   2295
  46.    End
  47.    Begin VB.DriveListBox Drive1 
  48.       Height          =   315
  49.       Left            =   780
  50.       TabIndex        =   2
  51.       Top             =   3600
  52.       Width           =   2655
  53.    End
  54.    Begin VB.FileListBox File1 
  55.       Height          =   2760
  56.       Left            =   3660
  57.       TabIndex        =   1
  58.       Top             =   720
  59.       Width           =   2295
  60.    End
  61.    Begin VB.DirListBox Dir1 
  62.       Height          =   2730
  63.       Left            =   780
  64.       TabIndex        =   0
  65.       Top             =   720
  66.       Width           =   2655
  67.    End
  68.    Begin VB.Label Label3 
  69.       Caption         =   "File to Compress"
  70.       Height          =   195
  71.       Left            =   4020
  72.       TabIndex        =   9
  73.       Top             =   480
  74.       Width           =   1635
  75.    End
  76.    Begin VB.Label Label2 
  77.       Caption         =   "UnCompress To:"
  78.       Height          =   255
  79.       Left            =   1680
  80.       TabIndex        =   8
  81.       Top             =   4320
  82.       Width           =   1215
  83.    End
  84.    Begin VB.Label Label1 
  85.       Caption         =   "Compress To:"
  86.       Height          =   255
  87.       Left            =   1680
  88.       TabIndex        =   7
  89.       Top             =   3960
  90.       Width           =   975
  91.    End
  92.    Begin CompactLibCtl.Compact Compact1 
  93.       Left            =   0
  94.       Top             =   4680
  95.       _version        =   65536
  96.       _extentx        =   2143
  97.       _extenty        =   873
  98.       _stockprops     =   0
  99.    End
  100. Attribute VB_Name = "Form1"
  101. Attribute VB_Creatable = False
  102. Attribute VB_Exposed = False
  103. DefInt A-Z
  104. Private Sub Command1_Click()
  105.     Dim FileName As String
  106.     Dim TempBuffer As String
  107.     TempBuffer = Dir1.Path
  108.     If Right$(TempBuffer, 1) <> "\" Then TempBuffer = TempBuffer + "\"
  109.     If File1.ListIndex >= 0 Then
  110.         FileName = TempBuffer + File1.List(File1.ListIndex)
  111.         With Compact1
  112.          .SetMousePointer = True
  113.          .OutFile = Text1.Text
  114.          .FileName = FileName
  115.         End With
  116.         MsgBox ("Compression complete!")
  117.      End If
  118. End Sub
  119. Private Sub Command2_Click()
  120.     Dim FileName As String
  121.     Dim TempBuffer As String
  122.     TempBuffer = Dir1.Path
  123.     If Right$(TempBuffer, 1) <> "\" Then TempBuffer = TempBuffer + "\"
  124.     If File1.ListIndex >= 0 Then
  125.         FileName = TempBuffer + File1.List(File1.ListIndex)
  126.         With Compact1
  127.          .SetMousePointer = True
  128.          .NewFilename = Text2.Text
  129.          .CompressedFilename = FileName
  130.         End With
  131.         MsgBox ("UnCompression complete!")
  132.      End If
  133. End Sub
  134. Private Sub Dir1_Change()
  135.     File1.Path = Dir1.Path
  136. End Sub
  137. Private Sub Drive1_Change()
  138.     Dir1.Path = Drive1.Drive
  139. End Sub
  140. Private Sub Form_Load()
  141.     Show
  142. End Sub
  143.