home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / MultiGradi762724262002.psc / MultiGradient / Form2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-04-20  |  4.5 KB  |  152 lines

  1. VERSION 5.00
  2. Begin VB.Form Form2 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Save MultiGradient"
  5.    ClientHeight    =   4305
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4050
  9.    ControlBox      =   0   'False
  10.    LinkTopic       =   "Form2"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    Moveable        =   0   'False
  14.    ScaleHeight     =   4305
  15.    ScaleWidth      =   4050
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.CommandButton Command2 
  18.       Caption         =   "Cancel"
  19.       Height          =   330
  20.       Left            =   2745
  21.       TabIndex        =   5
  22.       Top             =   1080
  23.       Width           =   1230
  24.    End
  25.    Begin VB.CommandButton Command1 
  26.       Caption         =   "OK ! Save..."
  27.       Height          =   330
  28.       Left            =   2745
  29.       TabIndex        =   4
  30.       Top             =   675
  31.       Width           =   1230
  32.    End
  33.    Begin VB.TextBox Text1 
  34.       BackColor       =   &H00E0E0E0&
  35.       Height          =   285
  36.       Left            =   90
  37.       TabIndex        =   2
  38.       Text            =   "Text1"
  39.       Top             =   270
  40.       Width           =   3885
  41.    End
  42.    Begin VB.Frame Frame1 
  43.       Caption         =   "Gradients"
  44.       BeginProperty Font 
  45.          Name            =   "MS Sans Serif"
  46.          Size            =   9.75
  47.          Charset         =   0
  48.          Weight          =   700
  49.          Underline       =   0   'False
  50.          Italic          =   0   'False
  51.          Strikethrough   =   0   'False
  52.       EndProperty
  53.       ForeColor       =   &H000000C0&
  54.       Height          =   3615
  55.       Left            =   90
  56.       TabIndex        =   0
  57.       Top             =   585
  58.       Width           =   2445
  59.       Begin VB.FileListBox File1 
  60.          BackColor       =   &H00E0E0E0&
  61.          BeginProperty Font 
  62.             Name            =   "MS Sans Serif"
  63.             Size            =   8.25
  64.             Charset         =   0
  65.             Weight          =   700
  66.             Underline       =   0   'False
  67.             Italic          =   0   'False
  68.             Strikethrough   =   0   'False
  69.          EndProperty
  70.          ForeColor       =   &H00C00000&
  71.          Height          =   3210
  72.          Left            =   45
  73.          Pattern         =   "*.mgr"
  74.          TabIndex        =   1
  75.          Top             =   315
  76.          Width           =   2310
  77.       End
  78.    End
  79.    Begin VB.Label Label1 
  80.       Caption         =   "GradientName:"
  81.       BeginProperty Font 
  82.          Name            =   "MS Sans Serif"
  83.          Size            =   8.25
  84.          Charset         =   0
  85.          Weight          =   700
  86.          Underline       =   0   'False
  87.          Italic          =   0   'False
  88.          Strikethrough   =   0   'False
  89.       EndProperty
  90.       ForeColor       =   &H000000C0&
  91.       Height          =   195
  92.       Left            =   90
  93.       TabIndex        =   3
  94.       Top             =   45
  95.       Width           =   1770
  96.    End
  97. Attribute VB_Name = "Form2"
  98. Attribute VB_GlobalNameSpace = False
  99. Attribute VB_Creatable = False
  100. Attribute VB_PredeclaredId = True
  101. Attribute VB_Exposed = False
  102. Private Sub Command1_Click() 'save gradient
  103. On Error GoTo SaveError
  104. MGFile = Text1
  105. If LCase(Right(MGFile, 4)) <> ".mgr" Then MGFile = MGFile + ".Mgr"
  106. For xx = 0 To File1.ListCount - 1
  107.     If LCase(MGFile) = LCase(File1.List(xx)) Then
  108.     Temp = MsgBox("The file " & MGFile & " allready exists." & vbCr & "Do you want to replace the file ?", vbYesNo + vbQuestion, MGTitle)
  109.         If Temp = vbNo Then
  110.         Text1.SelStart = 0
  111.         Text1.SelLength = Len(Text1)
  112.         Text1.SetFocus
  113.         Exit Sub
  114.         End If
  115.     End If
  116. Next xx
  117. For xx = 0 To 9
  118. Mgpct2(xx) = MGPct(xx) * 10000
  119. Next xx
  120. ff = FreeFile
  121. Open File1.Path & "\" & MGFile For Output As #ff
  122. For xx = 0 To 9
  123. Print #ff, MGrad(xx)
  124. Print #ff, Mgpct2(xx)
  125. Next xx
  126. Close #ff
  127. Form1.File1.Refresh
  128. File1.Refresh
  129. Form1.Label7 = "Last action: Save gradient"
  130. Form2.Hide
  131. Exit Sub
  132. SaveError:
  133. Close #ff
  134. MsgBox "Error " & Err.Number & vbCr & Err.Description, , MGTitle
  135. End Sub
  136. Private Sub Command2_Click()
  137. Form2.Hide
  138. End Sub
  139. Private Sub File1_Click()
  140. Text1 = File1.List(File1.ListIndex)
  141. End Sub
  142. Private Sub Form_Activate()
  143. File1.Refresh
  144. Text1 = Form1.Label6
  145. Text1.SelStart = 0
  146. Text1.SelLength = Len(Text1)
  147. Text1.SetFocus
  148. End Sub
  149. Private Sub Form_Load()
  150. File1.Path = App.Path + "\Gradients"
  151. End Sub
  152.