the word processor edit menu. the edit menu 4 copy –clear the clipboard –move selected text to...
TRANSCRIPT
The Word Processor Edit Menu
The Edit MenuCopy
–Clear the Clipboard–Move selected text to Clipboard
Cut–Clear the Clipboard–Move selected text to Clipboard–Replace selected text with “nothing”
The Edit MenuPaste
– retrieve it from the Clipboard– make it the "selected" text
Select All– Place cursor at beginning of text– Make length of selected text the same as
the length of all the text
Properties of Text BoxSelLength - the length (in
bytes) of the text SelStart - the position of the
cursor from top of page. SelText - the text that is
selected (highlighted)
Methods of the Clipboard SetText - paste text from clipboard
Clipboard.SetText txtWord.SelText
GetText - copy text to clipboard
txtWord.SelText = Clipboard.GetText
Clear – clear the clipboard
Clipboard.Clear
Copying Text clear Clipboard place the selected text from the text
window into the Clipboard
Clipboard.ClearClipboard.SetText txtWord.SelText
Cutting Text clear Clipboard place the selected text from the text
window into the Clipboard Replace selected text with “nothing”
Clipboard.ClearClipboard.SetText txtWord.SelTexttxtWord.SelText = “”
Pasting TextRetrieve text from Clipboard
and make it the "selected" text
txtWord.SelText = Clipboard.GetText
Select All move the cursor to top of page
txtWord.SelStart = 0
make the length of the select text equal to the length of the text in the text box
txtWord.SelLength = Len(txtWord.Text)
The Edit Menu
When can you copy or cut text? (Or, even better, when can't you?)
Can’t copy or cut if no text has been selected!
Use SelLength property to ensure text has been selected (if SelLength > 0, then text has been selected)
Use Enabled property to make menu item available (or not!)
The Edit MenuIf (txtWord.SelLength > 0) Then
mnuCopy.Enabled = TruemnuCut.Enabled = True
ElsemnuCopy.Enabled = FalsemnuCut.Enabled = False
End If
The Edit MenuCannot paste if clipboard is empty!
If (Len(Clipboard.GetText) > 0) Then mnuPaste.Enabled = True
ElsemnuPaste.Enabled = False
End If
HomeworkAdd cut, copy, paste, and select
all to you word processor
Add routines to check status of cut, copy, and paste in the Edit menu.