Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

Chapter 16 Inheriting Forms and Creating Base Classes 397


Now you’ll add a few new elements to the inherited form.

Customize the inherited form


  1. Use the Button control to add a third button object near the middle of Form2 (the
    inherited form).

  2. Set the Text property for the button object to “Click Me!”

  3. Double-click the Click Me! button.

  4. In the Button3_Click event procedure, type the following program statement:


MsgBox("This is the inherited form!")


  1. Display Form2 again, and then try double-clicking the OK and Cancel buttons on
    the form.
    Notice that you can’t display or edit the event procedures or properties for these
    inherited objects without taking additional steps that are beyond the scope of this
    chapter. (Tiny “lock” icons indicate that the inherited objects are read-only .) However,
    you can add new objects to the form or customize it in other ways.

Free download pdf