Your first event handler

This assignment tests your ability to write programs with one-instruction event handlers.

Begin by carefully reading the note on event handlers and the notes on the VS.NET Development System, including the one on the code window which we use in this assignment.

The first program with event handlers has two event handlers, one for the event that the user clicks on the "stop the program" button and one for the event that the user clicks on the "display the message" button. Write an identical program. When it is working, turn in a screen shot of the program while it is executing and listings of your object definitions and event handlers (from the end of the form1.vb file). You do not have to turn in a listing of the entire program.

Hint: Since the program will display multiple lines of output in the text box, be sure to set the value of its Multiline property to true.

Next, modify your program as follows, and answer these questions:

  1. What happens if you change the argument of the AppendText method from:

    ("Hello, my friend!  ")
    

    to:

    ("Hello, my friend!")  (No spaces after the exclamation point)
    

  2. What if you change it to:

    ("Hello, my friend!  " & vbCrLf)
    

  3. What if you change it to:

    ("Hello, my friend!  " & vbCrLf &vbCrLf)
    

  4. What happens if you set the Scrollbar property of the TextBox to vertical?

  5. What is the meaning of the vbCrLf constant? (Hint: look back at the non-printing ASCII characters 10 and 13).


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.