home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / Ghost_typi19605712292005.psc / GhostT2.frm < prev    next >
Text File  |  2005-12-30  |  6KB  |  178 lines

  1. VERSION 5.00
  2. Begin VB.Form GhostT2 
  3.    ClientHeight    =   4845
  4.    ClientLeft      =   60
  5.    ClientTop       =   450
  6.    ClientWidth     =   4725
  7.    Icon            =   "GhostT2.frx":0000
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   4845
  10.    ScaleWidth      =   4725
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton cmdGhost 
  13.       Caption         =   "Notes"
  14.       Height          =   315
  15.       Index           =   3
  16.       Left            =   3600
  17.       TabIndex        =   5
  18.       Top             =   4440
  19.       Width           =   855
  20.    End
  21.    Begin VB.CommandButton cmdGhost 
  22.       Caption         =   "Details"
  23.       Height          =   315
  24.       Index           =   1
  25.       Left            =   1200
  26.       TabIndex        =   4
  27.       Top             =   4440
  28.       Width           =   855
  29.    End
  30.    Begin VB.CommandButton cmdGhost 
  31.       Caption         =   "Append"
  32.       Height          =   315
  33.       Index           =   2
  34.       Left            =   2400
  35.       TabIndex        =   3
  36.       Top             =   4440
  37.       Width           =   855
  38.    End
  39.    Begin VB.CommandButton cmdGhost 
  40.       Caption         =   "Intro"
  41.       Height          =   315
  42.       Index           =   0
  43.       Left            =   120
  44.       TabIndex        =   2
  45.       Top             =   4440
  46.       Width           =   855
  47.    End
  48.    Begin VB.TextBox txtGhost 
  49.       BeginProperty Font 
  50.          Name            =   "MS Sans Serif"
  51.          Size            =   13.5
  52.          Charset         =   0
  53.          Weight          =   400
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   3135
  59.       Left            =   0
  60.       MultiLine       =   -1  'True
  61.       ScrollBars      =   2  'Vertical
  62.       TabIndex        =   1
  63.       Top             =   0
  64.       Width           =   4695
  65.    End
  66.    Begin VB.Label lblGhost 
  67.       Alignment       =   2  'Center
  68.       BackColor       =   &H00C0C0C0&
  69.       BackStyle       =   0  'Transparent
  70.       BeginProperty Font 
  71.          Name            =   "Lucida Handwriting"
  72.          Size            =   36
  73.          Charset         =   0
  74.          Weight          =   700
  75.          Underline       =   0   'False
  76.          Italic          =   -1  'True
  77.          Strikethrough   =   0   'False
  78.       EndProperty
  79.       ForeColor       =   &H00C0FFFF&
  80.       Height          =   975
  81.       Left            =   120
  82.       TabIndex        =   0
  83.       Top             =   3480
  84.       Width           =   4335
  85.    End
  86. End
  87. Attribute VB_Name = "GhostT2"
  88. Attribute VB_GlobalNameSpace = False
  89. Attribute VB_Creatable = False
  90. Attribute VB_PredeclaredId = True
  91. Attribute VB_Exposed = False
  92. Option Explicit
  93.  
  94.  
  95. Private Sub cmdGhost_Click(Index As Integer)
  96.  
  97.   Enabler cmdGhost, False
  98.   Select Case Index
  99.    Case 0 'Intro
  100.     DoIntro
  101.    Case 1 'Details
  102.     RandTypistText txtGhost, "These routines take a control and a string message as parameters.", 70, True
  103.     Pause 4
  104.     RandTypistText txtGhost, vbNewLine & _
  105.      "They also have an Optional parameter 'Speed'. This limits the maximum length of a pause between letters (one second/Speed). Values less than 5 produce the best illusion." & vbNewLine, 2, False
  106.     Pause 6
  107.     RandTypistText txtGhost, vbNewLine & _
  108.      "The RandTypistText routine has an additional Optional parameter 'bClearText' which allows you to clear the previous text first (Default True). ", 90, False
  109.     RandTypistText txtGhost, vbNewLine & _
  110.      "Click 'Append' the effect of setting this parameter to False.", 100, False
  111.    Case 2 'Append
  112.     RandTypistText txtGhost, vbNewLine & _
  113.      "RandTypistText can optionally append new text to an existing text." & vbNewLine & "Click 'Notes' to see the effect of 'bClearText' = True", 60, False
  114.    Case 3 'Notes
  115.     RandTypistText txtGhost, "Because the Caption property has to be completely redisplayed you should not use RandTypistCaption to display long messages as they will flicker while updating. Watch the label below as a long message is feed to it", 50
  116.     RandTypistCaption lblGhost, "Demo of the flicker effect for very long caption messages", 80
  117.     RandTypistText txtGhost, vbNewLine & _
  118.      "RandTypistText can append to existing text so does not flicker(much).", 10, False
  119.     RandTypistText txtGhost, vbNewLine & _
  120.      "These routines do not attempt to set the Font or colour of the control. You might want to add these complications.", 10, False
  121.     RandTypistCaption lblGhost, "ENJOY!"
  122.   End Select
  123.   Enabler cmdGhost, True
  124.  
  125. End Sub
  126.  
  127. Private Sub DoIntro()
  128.  
  129. 'allows 2 different routines to call the intro
  130.  cmdGhost(0).Caption = ""
  131. cmdGhost(1).Caption = ""
  132. cmdGhost(2).Caption = ""
  133. cmdGhost(3).Caption = ""
  134. lblGhost.Caption = ""
  135. Me.Caption = ""
  136.   RandTypistCaption Me, "Ghost Typer 2", 30
  137.   RandTypistText txtGhost, "Sub-routines make coding simpler and more flexible!" & vbNewLine & _
  138.    "This code uses 2 sub-routines that allow you to type messages to either the Caption or Text property of a control without using Timer controls.", 10
  139.   RandTypistCaption lblGhost, "ENJOY!"
  140.   RandTypistText txtGhost, vbNewLine & "Click 'Details' for more.", 110, False
  141.   
  142. RandTypistCaption cmdGhost(0), "Intro", 4
  143. RandTypistCaption cmdGhost(1), "Details", 3
  144. RandTypistCaption cmdGhost(2), "Append", 2
  145. RandTypistCaption cmdGhost(3), "Notes"
  146. Enabler cmdGhost, True
  147. End Sub
  148.  
  149. Private Sub Enabler(CtrlArray As Variant, _
  150.                     ByVal bEnabled As Boolean)
  151.  
  152.   Dim C As Variant
  153.  
  154.   For Each C In CtrlArray
  155.     C.Enabled = bEnabled
  156.   Next C
  157.  
  158. End Sub
  159.  
  160. Private Sub Form_Load()
  161.  
  162.   Show 'force form to show before the DoIntro routine fires
  163.   Randomize
  164.   Enabler cmdGhost, False
  165.   DoIntro
  166.  
  167. End Sub
  168.  
  169. Private Sub Form_Unload(Cancel As Integer)
  170.  
  171.   End
  172.  
  173. End Sub
  174.  
  175. ':)Code Fixer V4.0.29 (Friday, 30 December 2005 14:07:46) 7 + 66 = 73 Lines Thanks Ulli for inspiration and lots of code.
  176. ':)SETTINGS DUMP: 133302322223333232|33332222222222222222222222222202|1112222|2221222|222222222233|111111111111|1122222222220|333333|
  177.  
  178.