home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / zlibocx / form21.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-06-23  |  5.3 KB  |  165 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  4. Object = "{F79ED619-0A0D-11D2-9F03-F39552419543}#6.0#0"; "zlib15.ocx"
  5. Begin VB.Form Form1 
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "Zlib StringCompress 1.5 Sample Project"
  8.    ClientHeight    =   5700
  9.    ClientLeft      =   45
  10.    ClientTop       =   615
  11.    ClientWidth     =   6030
  12.    Icon            =   "Form21.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   5700
  16.    ScaleWidth      =   6030
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin MaqZlib20.Zlib Zlib1 
  19.       Left            =   1920
  20.       Top             =   1800
  21.       _ExtentX        =   1032
  22.       _ExtentY        =   1032
  23.    End
  24.    Begin MSComDlg.CommonDialog CommonDialog1 
  25.       Left            =   1680
  26.       Top             =   1800
  27.       _ExtentX        =   847
  28.       _ExtentY        =   847
  29.       _Version        =   327681
  30.    End
  31.    Begin VB.CommandButton Command4 
  32.       Caption         =   "Uncompress file"
  33.       Height          =   495
  34.       Left            =   3480
  35.       TabIndex        =   6
  36.       Top             =   5040
  37.       Width           =   1815
  38.    End
  39.    Begin VB.CommandButton Command3 
  40.       Caption         =   "Compress file"
  41.       Height          =   495
  42.       Left            =   840
  43.       TabIndex        =   5
  44.       Top             =   5040
  45.       Width           =   1815
  46.    End
  47.    Begin VB.CommandButton Command2 
  48.       Caption         =   "Uncompress string"
  49.       Height          =   495
  50.       Left            =   3480
  51.       TabIndex        =   4
  52.       Top             =   4440
  53.       Width           =   1815
  54.    End
  55.    Begin VB.CommandButton Command1 
  56.       Caption         =   "Compress string"
  57.       Height          =   495
  58.       Left            =   840
  59.       TabIndex        =   3
  60.       Top             =   4440
  61.       Width           =   1815
  62.    End
  63.    Begin RichTextLib.RichTextBox RichTextBox3 
  64.       Height          =   1335
  65.       Left            =   120
  66.       TabIndex        =   2
  67.       ToolTipText     =   "Here will apear the reconstructed text"
  68.       Top             =   3000
  69.       Width           =   5775
  70.       _ExtentX        =   10186
  71.       _ExtentY        =   2355
  72.       _Version        =   327681
  73.       Enabled         =   -1  'True
  74.       ScrollBars      =   2
  75.       TextRTF         =   $"Form21.frx":0ABA
  76.    End
  77.    Begin RichTextLib.RichTextBox RichTextBox2 
  78.       Height          =   1335
  79.       Left            =   120
  80.       TabIndex        =   1
  81.       ToolTipText     =   "Here the compressed output will apear"
  82.       Top             =   1560
  83.       Width           =   5775
  84.       _ExtentX        =   10186
  85.       _ExtentY        =   2355
  86.       _Version        =   327681
  87.       Enabled         =   -1  'True
  88.       ScrollBars      =   2
  89.       TextRTF         =   $"Form21.frx":0B83
  90.    End
  91.    Begin RichTextLib.RichTextBox RichTextBox1 
  92.       Height          =   1335
  93.       Left            =   120
  94.       TabIndex        =   0
  95.       ToolTipText     =   "Type here the text to be compressed"
  96.       Top             =   120
  97.       Width           =   5775
  98.       _ExtentX        =   10186
  99.       _ExtentY        =   2355
  100.       _Version        =   327681
  101.       Enabled         =   -1  'True
  102.       ScrollBars      =   2
  103.       TextRTF         =   $"Form21.frx":0C4C
  104.    End
  105.    Begin VB.Menu about 
  106.       Caption         =   "About"
  107.    End
  108. Attribute VB_Name = "Form1"
  109. Attribute VB_GlobalNameSpace = False
  110. Attribute VB_Creatable = False
  111. Attribute VB_PredeclaredId = True
  112. Attribute VB_Exposed = False
  113. Private Sub about_Click()
  114. Zlib1.AboutBox
  115. End Sub
  116. Private Sub Command1_Click()
  117. Dim Myinput As String
  118. Dim Myoutput As String
  119. Dim Myreturn As Boolean
  120. Myinput = RichTextBox1.Text
  121. Myreturn = Zlib1.ZlibCompress(Myinput, Myoutput)
  122. RichTextBox2.Text = Myoutput
  123. End Sub
  124. Private Sub Command2_Click()
  125. Dim Myinput As String
  126. Dim Myoutput As String
  127. Dim Myreturn As Boolean
  128. Myinput = RichTextBox2.Text
  129. Myreturn = Zlib1.ZlibUncompress(Myinput, Myoutput)
  130. RichTextBox3.Text = Myoutput
  131. End Sub
  132. Private Sub Command3_Click()
  133. CommonDialog1.Filter = "All Files (*.*)|*.*"
  134. CommonDialog1.FilterIndex = 1
  135. CommonDialog1.ShowOpen
  136. If CommonDialog1.filename = "" Then Exit Sub
  137. Dim Myinput As String
  138. Dim Myoutput As String
  139. Dim Myreturn As Boolean
  140. Myinput = CommonDialog1.filename
  141. CommonDialog1.filename = CommonDialog1.filename & ".gz"
  142. CommonDialog1.Filter = "All Files (*.*)|*.*"
  143. CommonDialog1.FilterIndex = 1
  144. CommonDialog1.ShowSave
  145. If CommonDialog1.filename = "" Then Exit Sub
  146. Myoutput = CommonDialog1.filename
  147. Myreturn = Zlib1.ZlibCompressFile(Myinput, Myoutput, "9")
  148. End Sub
  149. Private Sub Command4_Click()
  150. CommonDialog1.Filter = "All Files (*.*)|*.*"
  151. CommonDialog1.FilterIndex = 1
  152. CommonDialog1.ShowOpen
  153. If CommonDialog1.filename = "" Then Exit Sub
  154. Dim Myinput As String
  155. Dim Myoutput As String
  156. Dim Myreturn As Boolean
  157. Myinput = CommonDialog1.filename
  158. CommonDialog1.Filter = "All Files (*.*)|*.*"
  159. CommonDialog1.FilterIndex = 1
  160. CommonDialog1.ShowSave
  161. If CommonDialog1.filename = "" Then Exit Sub
  162. Myoutput = CommonDialog1.filename
  163. Myreturn = Zlib1.ZlibUnCompressFile(Myinput, Myoutput)
  164. End Sub
  165.