the word processor edit menu. the edit menu 4 copy –clear the clipboard –move selected text to...

13
The Word Processor Edit Menu

Upload: ferdinand-richards

Post on 14-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

The Word Processor Edit Menu

Page 2: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

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”

Page 3: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

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

Page 4: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected 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)

Page 5: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

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

Page 6: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

Copying Text clear Clipboard place the selected text from the text

window into the Clipboard

Clipboard.ClearClipboard.SetText txtWord.SelText

Page 7: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

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 = “”

Page 8: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

Pasting TextRetrieve text from Clipboard

and make it the "selected" text

txtWord.SelText = Clipboard.GetText

Page 9: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

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)

Page 10: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected 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!)

Page 11: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

The Edit MenuIf (txtWord.SelLength > 0) Then

mnuCopy.Enabled = TruemnuCut.Enabled = True

ElsemnuCopy.Enabled = FalsemnuCut.Enabled = False

End If

Page 12: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

The Edit MenuCannot paste if clipboard is empty!

If (Len(Clipboard.GetText) > 0) Then mnuPaste.Enabled = True

ElsemnuPaste.Enabled = False

End If

Page 13: The Word Processor Edit Menu. The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text

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.