Example for Week 5 - Step by Step

 

Part 1 - Housekeeping / Overhead

Save the Project in your NEW Project directory


Part 2 - Building the Example Application

This program will create the first part of a VERY simple text editor. It will incorporate changes to Background Colors, Forground Colors and Fonts. It must also implement the Copy, Cut, Paste logic and the Select All options under the Edit Menu. Show a simple About Box from under the help selection.

Build the User Interface

Working mostly with the Menu Editor. Build the menu as shown. In addition, include a File | Exit with the appropriate shortcut key and a Help | About that displays a message box like the one shown.

Example5.jpg (10495 bytes) HelpAbout.jpg (9447 bytes)

Add a TextBox and size it so that it covers the entire form.

The Text Box will be the target of all Clipboard and Dialog operations. Work out the keyboard interface before beginning the code portion of the example.

Don't forget to add the Common Dialog control. You will need it to select Colors and Fonts.

Done with the user interface?

Run the program: Click on Run | Start With Full Compile

Test Keyboard Interface one more time.

You have completed the user interface


Build the Event Handlers

mnuExit
Unload Me instead of Exit. More on this next week.

mnuAbout
MsgBox "Written as an Example" & vbCrLf & _
                "for Week 5" & vbCrLf & _
                "By Mike", _
                vbInformation + vbOKOnly, _
                "About Example 5"

Dialog and Edit Selections

All of this logic was detailed on the main page for Week 5

Finish up the testing and be sure to save the project.


A couple of thoughts before this example is complete.

Building the menu structure is easy. Become familiar with the standards for Keyboard Shortcuts commonly used in the Windows environment.

When using the Common Dialogs you must be familiar with the Flags parameter used for each Show method. Initialize Dialog Properties including the Flags property, Show the Dialog, and then use the selected Dialog properties to set the properties of your form controls.

Copy Cut and Paste uses the Clipboard Methods. You can basicly use the clipboard to "store stuff" and to "retreive stuff". There is a clear and a query method also.


Back to Week 5