*/
Know a good article or link that we're missing? Submit it!
*/

View \frmTextEdit.frm

WinDOS Shell 0.1A

Submitted By: Shehbaz
Rating: starstarstarstarstar (Rate It)


VERSION 5.00
Begin VB.Form frmTextEdit
   BackColor       =   &H00000000&
   BorderStyle     =   0  'None
   Caption         =   "AI Text Edit"
   ClientHeight    =   9000
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   12000
   ForeColor       =   &H00FFFFFF&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   WindowState     =   2  'Maximized
   Begin VB.TextBox txtFileName
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   120
      Locked          =   -1  'True
      TabIndex        =   1
      Top             =   8280
      Width           =   10215
   End
   Begin VB.TextBox txtContents
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   7575
      Left            =   0
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Top             =   0
      Width           =   11895
   End
   Begin VB.Label lblClear
      BackStyle       =   0  'Transparent
      Caption         =   "Clear"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   21.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   8400
      TabIndex        =   7
      Top             =   7680
      Width           =   1815
   End
   Begin VB.Label lblPaste
      BackStyle       =   0  'Transparent
      Caption         =   "Paste"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   21.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   6240
      TabIndex        =   6
      Top             =   7680
      Width           =   1815
   End
   Begin VB.Label lblCopy
      BackStyle       =   0  'Transparent
      Caption         =   "Copy"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   21.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   495
      Left            =   4320
      TabIndex        =   5
      Top             =   7680
      Width           =   1575
   End
   Begin VB.Label lblLoadFile
      BackStyle       =   0  'Transparent
      Caption         =   "Load"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   21.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   7680
      Width           =   1575
   End
   Begin VB.Label lblSaveFile
      BackStyle       =   0  'Transparent
      Caption         =   "Save"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   21.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   2160
      TabIndex        =   3
      Top             =   7680
      Width           =   1575
   End
   Begin VB.Label lblExit
      BackStyle       =   0  'Transparent
      Caption         =   "EXIT"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   24
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   615
      Left            =   10560
      TabIndex        =   2
      Top             =   8160
      Width           =   1215
   End
End
Attribute VB_Name = "frmTextEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Label2_Click()

End Sub

Private Sub lblClear_Click()
Dim ans As String
ans = MsgBox("Are you sure?", vbYesNo + vbExclamation, "Question")
If ans = vbYes Then
txtContents.Text = ""
txtFileName.Text = ""
End If
End Sub

Private Sub lblClear_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblClear.ForeColor = &HC0&
End Sub

Private Sub lblClear_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblClear.ForeColor = &HFF00&
End Sub

Private Sub lblCopy_Click()
Clipboard.Clear
Clipboard.SetText (txtContents.SelText)
End Sub

Private Sub lblCopy_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblCopy.ForeColor = &HC0&
End Sub

Private Sub lblCopy_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblCopy.ForeColor = &HFF00&
End Sub

Private Sub lblExit_Click()
Unload Me
End Sub

Private Sub lblExit_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblExit.ForeColor = &HC0&
End Sub

Private Sub lblExit_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblExit.ForeColor = &HFF00&
End Sub

Private Sub lblLoadFile_Click()
    txtFileName.Locked = False
    txtContents.Text = "Please Enter File Name"
    txtFileName.SetFocus
End Sub

Private Sub lblLoadFile_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblLoadFile.ForeColor = &HC0&
End Sub

Private Sub lblLoadFile_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblLoadFile.ForeColor = &HFF00&
End Sub

Private Sub lblPaste_Click()
txtContents.Text = txtContents.Text & Clipboard.GetText
End Sub

Private Sub lblPaste_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblPaste.ForeColor = &HC0&
End Sub

Private Sub lblPaste_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblPaste.ForeColor = &HFF00&
End Sub

Private Sub lblSaveFile_Click()
Dim filepath As String
On Error GoTo err
If txtFileName.Text = "" Then
MsgBox "Please Enter a file name", vbOKOnly, "Error"
txtFileName.Locked = False
Else
filepath = txtFileName.Text
Open filepath For Append As #1
Print #1, txtContents.Text
Close #1
GoTo okay
End If
err:
MsgBox "Error!  number:" & err.Number & "  possibly " & err.Description
okay:
End Sub

Private Sub lblSaveFile_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblSaveFile.ForeColor = &HC0&
End Sub

Private Sub lblSaveFile_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblSaveFile.ForeColor = &HFF00&
End Sub

Private Sub txtFileName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Dim f As String
    On Error GoTo err
    Open txtFileName.Text For Input As #2
    Do Until EOF(2)
        Line Input #2, f
        txtContents.Text = txtContents.Text & f & "                             "
    Loop
    Close #2
    txtFileName.Locked = True
    txtContents.SetFocus
GoTo okay
err:
MsgBox "Error!  number:" & err.Number & "  possibly " & err.Description
okay:

End If
End Sub

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.