Download presentation
Presentation is loading. Please wait.
Published byPatrick Conley Modified over 9 years ago
1
Word Processor Version.2
2
Methods Visual Basic is –Object Oriented –Event Driven Objects –Properties –Methods
3
Properties Can be set at design time –The Properties Window Can be set at run time by sending a message txtWord.FontBold = True
4
Methods Send Message at run time txtWord.Move 0, 0
5
Moving The Text Box Move the text box to the upper left corner of form Sent the text box a message to use its Move method to move to 0, 0 txtWord.Move 0, 0
6
Sizing the Text Box Make the text box the same size as the form Send the text box a message to set its height and width properties to the same as the forms txtWord.Height = frmWord.ScaleHeight txtWord.Width = frmWord.ScaleWidth
7
Adding Menus The Menu Editor is found under the Tools menu
8
The Menu Editor
9
Name and Caption Properties CaptionName &File mnuFile &OpenmnuOpen &SavemnuSave Save &AsmnuSaveAs
10
The Edit Menu CaptionName &EditmnuEdit Cu&t (Ctrl+X) &Copy (Ctrl+C) &Paste (Ctrl+V) &Delete - Select &All Time/&Date - Set &Font mnuCut mnuCopy mnuPaste mnuDelete mnuEditSep1 mnuSelectAll mnuTimeDate mnuEditSep2 mnuFont
11
The Search and Help Menus &Search &Find Find &Again Find/&Replace mnuSearch mnuFind mnuFindAgain mnuFindReplace &Help &About Ray's Word mnuHelp mnuAbout
12
Writing Code Put placeholders behind each menu item MsgBox “This feature is in progress”,,”MESSAGE”
13
The Exit Button Simple version Unload Me
14
The Exit Button If the user hasn’t saved their work, the computer should ask if they want to save first. Define a variable called Saved Set it to True Make it False when the text box changes
15
Exit Button Code In General Declarations –Private Saved as Integer In Form_Load –Saved = True In txtWord_Change() –Saved = False
16
Using A Message Box As A Function Dim Response as Integer Response = MsgBox(“Want to save first”,vbYesNo + vbQuestion, “Save?”)
17
The New Command Must be implemented like saved If the user has not saved his or her work, the computer should ask if they want to save first.
18
Homework Create the Word Processing.2 interface Place messages behind each item to indicate "in progress" Program New and Exit
19
Have a great week!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.