home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD14508242001.psc / frmAbout.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-01-22  |  8.2 KB  |  219 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAbout 
  3.    BackColor       =   &H00808000&
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    ClientHeight    =   2760
  6.    ClientLeft      =   45
  7.    ClientTop       =   45
  8.    ClientWidth     =   7020
  9.    ControlBox      =   0   'False
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2760
  14.    ScaleWidth      =   7020
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.PictureBox Picture2 
  18.       Appearance      =   0  'Flat
  19.       BackColor       =   &H80000005&
  20.       BorderStyle     =   0  'None
  21.       ForeColor       =   &H80000008&
  22.       Height          =   2055
  23.       Left            =   120
  24.       Picture         =   "frmAbout.frx":0000
  25.       ScaleHeight     =   2055
  26.       ScaleWidth      =   2775
  27.       TabIndex        =   2
  28.       ToolTipText     =   "Your Dream Home!"
  29.       Top             =   480
  30.       Width           =   2775
  31.    End
  32.    Begin VB.CommandButton cmdClose 
  33.       Cancel          =   -1  'True
  34.       Caption         =   "&Close"
  35.       Default         =   -1  'True
  36.       BeginProperty Font 
  37.          Name            =   "Tahoma"
  38.          Size            =   11.25
  39.          Charset         =   0
  40.          Weight          =   700
  41.          Underline       =   0   'False
  42.          Italic          =   0   'False
  43.          Strikethrough   =   0   'False
  44.       EndProperty
  45.       Height          =   495
  46.       Left            =   5640
  47.       TabIndex        =   1
  48.       Top             =   2160
  49.       Width           =   1215
  50.    End
  51.    Begin VB.Timer Timer1 
  52.       Interval        =   1
  53.       Left            =   5400
  54.       Top             =   480
  55.    End
  56.    Begin VB.PictureBox Picture1 
  57.       Align           =   1  'Align Top
  58.       BackColor       =   &H00000000&
  59.       BeginProperty Font 
  60.          Name            =   "Copperplate Gothic Light"
  61.          Size            =   9.75
  62.          Charset         =   0
  63.          Weight          =   600
  64.          Underline       =   0   'False
  65.          Italic          =   0   'False
  66.          Strikethrough   =   0   'False
  67.       EndProperty
  68.       ForeColor       =   &H000000FF&
  69.       Height          =   375
  70.       Left            =   0
  71.       ScaleHeight     =   21
  72.       ScaleMode       =   3  'Pixel
  73.       ScaleWidth      =   464
  74.       TabIndex        =   0
  75.       Top             =   0
  76.       Width           =   7020
  77.    End
  78.    Begin VB.Label Label1 
  79.       BackStyle       =   0  'Transparent
  80.       Caption         =   "Mortgage Calculator"
  81.       BeginProperty Font 
  82.          Name            =   "Impact"
  83.          Size            =   20.25
  84.          Charset         =   0
  85.          Weight          =   400
  86.          Underline       =   0   'False
  87.          Italic          =   -1  'True
  88.          Strikethrough   =   0   'False
  89.       EndProperty
  90.       ForeColor       =   &H00FF0000&
  91.       Height          =   735
  92.       Left            =   3120
  93.       TabIndex        =   3
  94.       Top             =   960
  95.       Width           =   3615
  96.    End
  97. Attribute VB_Name = "frmAbout"
  98. Attribute VB_GlobalNameSpace = False
  99. Attribute VB_Creatable = False
  100. Attribute VB_PredeclaredId = True
  101. Attribute VB_Exposed = False
  102. ' Code: Fading Text
  103. ' Author: Jonathan Roach
  104. ' Email: stormdev@golden.net
  105. ' Comments:
  106. ' Enjoy the code, votes and emails are always welcomed.
  107. ' Happy Coding !
  108. ' Update Notes,
  109. ' I have added the ability to having multiple messages
  110. ' displayed and rotated through the fade in and out
  111. ' routines. The new variable curMsg and MsgArray have been
  112. ' added to accomplish this, you can increase the size of the
  113. ' array or decrease it depending on how many messages you
  114. ' want to cycle through. Enjoy the code !
  115. 'Code revised by: R.Gross on 12-4-2000
  116. Dim colVal As Long          ' Variable to contain our rgb color value
  117. Dim counter As Integer      ' Counter to be used to increment/decrement rgb value
  118. Dim fIn As Boolean          ' Boolean, true/false variable to determine if we are fading in or fading out.
  119. ' *** Update ***
  120. Dim curMsg As Integer           ' Determines which message from the MsgArray to display
  121. Dim MsgArray(1 To 9) As String  ' New variable Array to allow us to display multiple messages
  122. Private Sub cmdClose_Click()
  123. ' Shutdown all components and end the program
  124. Timer1.Enabled = False
  125. Unload frmAbout
  126. End Sub
  127. Private Sub Form_Load()
  128. ' Setup our messages
  129. MsgArray(1) = "Mortgage Calculator"
  130. MsgArray(2) = "Find out what your new house will cost!"
  131. MsgArray(3) = "Put down as large a down payment as you can afford"
  132. MsgArray(4) = "Check out the neighborhood for best re-sale value"
  133. MsgArray(5) = "Shop around for a loan"
  134. ' Use a blank entry for a greater pause before the next message !
  135. MsgArray(6) = ""
  136. MsgArray(7) = "Thanks for using this program"
  137. MsgArray(8) = "Comments are always welcome"
  138. MsgArray(9) = "RGross_41@msn.com"
  139. ' Set the current message
  140. curMsg = 1
  141. ' Set our counter to zero
  142. counter = 0
  143. ' This is our boolean (true/false) variable which will be used
  144. ' to determin if we are fading the text in or out. To start we
  145. ' set it to true so our text will fade in first.
  146. fIn = True
  147. ' Show the form
  148. Me.Show
  149. cmdClose.SetFocus
  150. End Sub
  151. Private Sub Timer1_Timer()
  152. ' This is the timer that controls our fading in and out, if you
  153. ' increase the timers interval property, the fades will take longer,
  154. ' you can also alter the fade speed by increasing or decreasing the
  155. ' the value that is added to counter in the lines below.
  156. ' Check and see if we are fading the text in, fIn=true.
  157. If fIn = True Then
  158. ' If we are fading in then begin the fade routine.
  159. ' Check if our counter variable is less than or equal to our goal color,
  160. ' I used 170 because that is the rgb value for the red component that
  161. ' I wanted the color fade to stop at, but you can use any rgb value and
  162. ' the red green or blue components.
  163.     If counter <= 200 Then
  164.         ' Store our rgb color value into the colVal variable
  165.         ' Notice the counter variable as the red parameter in
  166.         ' the rgb call, the zeros for the green and blue
  167.         ' components will yield black, you can try putting
  168.         ' the counter variable in different components and
  169.         ' changing component values to get the color you
  170.         ' desire.
  171.         colVal = RGB(counter, 0, 0)
  172.         ' Set the forecolor of our picturebox to the new color
  173.         Picture1.ForeColor = colVal
  174.         ' Increment our counter variable, a higher + value
  175.         ' will increase fade speed while a lower value will
  176.         ' slow the fade down and make it more smooth.
  177.         counter = counter + 10
  178.     Else
  179.         ' If we have reached our final color then set the fIn variable to false
  180.         ' because we just faded the text in we need it false to fade out next.
  181.         fIn = False
  182.         ' Reset the counter
  183.         counter = 0
  184.     End If
  185. ' If fIn was false that means we are fading out now
  186. ' Basically the same code as above, so I won't comment heavily.
  187.     If counter <= 200 Then
  188.         colVal = RGB(200 - counter, 0, 0)
  189.         Picture1.ForeColor = colVal
  190.         counter = counter + 4
  191.     Else
  192.         fIn = True
  193.         counter = 0
  194.         ' Increment our Message Pointer
  195.         curMsg = curMsg + 1
  196.     End If
  197. End If
  198. ' Check if the curMsg is at the last ("Upper Boundary"UBound) position of our Array.
  199. If curMsg <= UBound(MsgArray) Then
  200.     ' Print the current message
  201.     SetTextPosition
  202.     Picture1.Print MsgArray(curMsg)
  203.     ' Reset our message pointer to the first message to loop through the MsgArray
  204.     curMsg = 1
  205. End If
  206. End Sub
  207. Private Sub SetTextPosition()
  208. ' Set our current x and y coordinates for writing to the picturebox.
  209. ' This line sets the CurrentX property based on the size of the msg
  210. ' and centers that line in the textbox horizontally.
  211. Picture1.CurrentX = (Picture1.ScaleWidth - Picture1.TextWidth(MsgArray(curMsg))) \ 2
  212. ' You could also use the above routine to center the text vertically, by replacing
  213. ' the .ScaleWidth with .ScaleHeight and .TextWidth with .TextHeight, for the CurrentY
  214. ' Co-ordinate.
  215. ' ie: Picture1.CurrentY = (Picture1.ScaleHeight - Picture1.TextHeight(MsgArray(curMsg))) \ 2
  216. ' For Now I will just hard code it as 1
  217. Picture1.CurrentY = 1
  218. End Sub
  219.