home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / controls / edactive.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-05-16  |  2.7 KB  |  102 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Using Screen.ActiveControl"
  4.    ClientHeight    =   4020
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1770
  7.    ClientWidth     =   7365
  8.    Height          =   4710
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4020
  12.    ScaleWidth      =   7365
  13.    Top             =   1140
  14.    Width           =   7485
  15.    Begin TextBox txtBuffer 
  16.       Height          =   2295
  17.       Left            =   4680
  18.       MultiLine       =   -1  'True
  19.       ScrollBars      =   3  'Both
  20.       TabIndex        =   1
  21.       Top             =   960
  22.       Width           =   2295
  23.    End
  24.    Begin TextBox txtEditBox 
  25.       Height          =   2295
  26.       Left            =   480
  27.       MultiLine       =   -1  'True
  28.       ScrollBars      =   3  'Both
  29.       TabIndex        =   0
  30.       Top             =   960
  31.       Width           =   2295
  32.    End
  33.    Begin Label Label2 
  34.       Caption         =   "Paste Buffer"
  35.       Height          =   255
  36.       Left            =   4680
  37.       TabIndex        =   3
  38.       Top             =   720
  39.       Width           =   1215
  40.    End
  41.    Begin Label Label1 
  42.       Caption         =   "Editing Box"
  43.       Height          =   255
  44.       Left            =   480
  45.       TabIndex        =   2
  46.       Top             =   720
  47.       Width           =   1215
  48.    End
  49.    Begin Menu mnuFile 
  50.       Caption         =   "&File"
  51.       Begin Menu mnuFileExit 
  52.          Caption         =   "E&xit"
  53.       End
  54.    End
  55.    Begin Menu mnuEdit 
  56.       Caption         =   "&Edit"
  57.       Begin Menu mnuEditCut 
  58.          Caption         =   "Cu&t"
  59.          Shortcut        =   ^X
  60.       End
  61.       Begin Menu mnuEditCopy 
  62.          Caption         =   "&Copy"
  63.          Shortcut        =   ^C
  64.       End
  65.       Begin Menu mnuEditPaste 
  66.          Caption         =   "&Paste"
  67.          Shortcut        =   ^V
  68.       End
  69.    End
  70. Option Explicit
  71. Dim msg1 As String
  72. Dim msg2 As String
  73. Sub Form_Load ()
  74.     msg1 = "The Editing box must be the active control!"
  75.     msg2 = "Do you know where the focus is?"
  76. End Sub
  77. Sub mnuEditCopy_Click ()
  78.     If screen.ActiveControl Is txtEditBox Then
  79.         txtBuffer.Text = txtEditBox.SelText
  80.     Else
  81.         MsgBox msg1, 0, msg2
  82.     End If
  83. End Sub
  84. Sub mnuEditCut_Click ()
  85.     If screen.ActiveControl Is txtEditBox Then
  86.         txtBuffer.Text = txtEditBox.SelText
  87.         txtEditBox.SelText = ""
  88.     Else
  89.         MsgBox msg1, 0, msg2
  90.     End If
  91. End Sub
  92. Sub mnuEditPaste_Click ()
  93.     If screen.ActiveControl Is txtEditBox Then
  94.          txtEditBox.SelText = txtBuffer.Text
  95.     Else
  96.         MsgBox msg1, 0, msg2
  97.     End If
  98. End Sub
  99. Sub mnuFileExit_Click ()
  100.     End
  101. End Sub
  102.