Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 The Word Processor Edit Menu

2 The Edit Menu 4 Copy –Clear the Clipboard –Move selected text to Clipboard 4 Cut –Clear the Clipboard –Move selected text to Clipboard –Replace selected text with “nothing”

3 The Edit Menu 4 Paste –retrieve it from the Clipboard –make it the "selected" text 4 Select All –Place cursor at beginning of text –Make length of selected text the same as the length of all the text

4 Properties of Text Box 4 SelLength - the length (in bytes) of the text 4 SelStart - the position of the cursor from top of page. 4 SelText - the text that is selected (highlighted)

5 Methods of the Clipboard 4 SetText - paste text from clipboard Clipboard.SetText txtWord.SelText 4 GetText - copy text to clipboard txtWord.SelText = Clipboard.GetText 4 Clear – clear the clipboard Clipboard.Clear

6 Copying Text 4 clear Clipboard 4 place the selected text from the text window into the Clipboard Clipboard.Clear Clipboard.SetText txtWord.SelText

7 Cutting Text 4 clear Clipboard 4 place the selected text from the text window into the Clipboard 4 Replace selected text with “nothing” Clipboard.Clear Clipboard.SetText txtWord.SelText txtWord.SelText = “”

8 Pasting Text 4 Retrieve text from Clipboard and make it the "selected" text txtWord.SelText = Clipboard.GetText

9 Select All 4 move the cursor to top of page txtWord.SelStart = 0 4 make the length of the select text equal to the length of the text in the text box txtWord.SelLength = Len(txtWord.Text)

10 The Edit Menu When can you copy or cut text? (Or, even better, when can't you?) 4 Can’t copy or cut if no text has been selected! 4 Use SelLength property to ensure text has been selected (if SelLength > 0, then text has been selected) 4 Use Enabled property to make menu item available (or not!)

11 The Edit Menu If (txtWord.SelLength > 0) Then mnuCopy.Enabled = True mnuCut.Enabled = True Else mnuCopy.Enabled = False mnuCut.Enabled = False End If

12 The Edit Menu Cannot paste if clipboard is empty! If (Len(Clipboard.GetText) > 0) Then mnuPaste.Enabled = True Else mnuPaste.Enabled = False End If

13 Homework 4 Add cut, copy, paste, and select all to you word processor 4 Add routines to check status of cut, copy, and paste in the Edit menu.


Download ppt "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."

Similar presentations


Ads by Google