home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 October / pcp156b.iso / handson / files / vbwkshp / examples / ReplaceDialog.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-03-30  |  3.1 KB  |  112 lines

  1. VERSION 5.00
  2. Begin VB.Form ReplaceDialog 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Replace"
  5.    ClientHeight    =   3195
  6.    ClientLeft      =   2760
  7.    ClientTop       =   3750
  8.    ClientWidth     =   4485
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   3195
  13.    ScaleWidth      =   4485
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.TextBox Text2 
  16.       BeginProperty Font 
  17.          Name            =   "MS Sans Serif"
  18.          Size            =   12
  19.          Charset         =   0
  20.          Weight          =   400
  21.          Underline       =   0   'False
  22.          Italic          =   0   'False
  23.          Strikethrough   =   0   'False
  24.       EndProperty
  25.       Height          =   420
  26.       Left            =   1560
  27.       TabIndex        =   1
  28.       Top             =   1320
  29.       Width           =   2535
  30.    End
  31.    Begin VB.TextBox Text1 
  32.       BeginProperty Font 
  33.          Name            =   "MS Sans Serif"
  34.          Size            =   12
  35.          Charset         =   0
  36.          Weight          =   400
  37.          Underline       =   0   'False
  38.          Italic          =   0   'False
  39.          Strikethrough   =   0   'False
  40.       EndProperty
  41.       Height          =   420
  42.       Left            =   1560
  43.       TabIndex        =   0
  44.       Top             =   480
  45.       Width           =   2535
  46.    End
  47.    Begin VB.CommandButton CancelButton 
  48.       Caption         =   "Cancel"
  49.       Height          =   375
  50.       Left            =   2520
  51.       TabIndex        =   3
  52.       Top             =   2160
  53.       Width           =   1215
  54.    End
  55.    Begin VB.CommandButton OKButton 
  56.       Caption         =   "OK"
  57.       Height          =   375
  58.       Left            =   720
  59.       TabIndex        =   2
  60.       Top             =   2160
  61.       Width           =   1215
  62.    End
  63.    Begin VB.Label Label2 
  64.       Caption         =   "Replace with"
  65.       Height          =   375
  66.       Left            =   120
  67.       TabIndex        =   5
  68.       Top             =   1440
  69.       Width           =   1215
  70.    End
  71.    Begin VB.Label Label1 
  72.       Caption         =   "Search For"
  73.       Height          =   495
  74.       Left            =   120
  75.       TabIndex        =   4
  76.       Top             =   600
  77.       Width           =   1335
  78.    End
  79. Attribute VB_Name = "ReplaceDialog"
  80. Attribute VB_GlobalNameSpace = False
  81. Attribute VB_Creatable = False
  82. Attribute VB_PredeclaredId = True
  83. Attribute VB_Exposed = False
  84. Option Explicit
  85. Public SearchText As String, ReplaceText As String
  86. Private Sub CancelButton_Click()
  87. SearchText = ""
  88. ReplaceText = ""
  89. Me.Hide
  90. End Sub
  91. Private Sub Form_Load()
  92. SearchText = ""
  93. ReplaceText = ""
  94. End Sub
  95. Private Sub OKButton_Click()
  96. SearchText = Text1.Text
  97. ReplaceText = Text2.Text
  98. Me.Hide
  99. End Sub
  100. Private Sub Text1_KeyPress(KeyAscii As Integer)
  101. If KeyAscii = 13 Then
  102.     Text2.SetFocus
  103. End If
  104. End Sub
  105. Private Sub Text2_KeyPress(KeyAscii As Integer)
  106. If KeyAscii = 13 Then
  107.     SearchText = Text1.Text
  108.     ReplaceText = Text2.Text
  109.     Me.Hide
  110. End If
  111. End Sub
  112.