Visual Basic
06 Option Button Program

Video Instruction

  1. Completed project overview.
  2. Setting up the form.
  3. Creating an option button array.
  4. Programming the options. Part 1, Part 2
  5. Clearing objects when a text box is changed.

 

Use one form to provide the following program. Save the form as 06_xxx_opt where xxx is your initials.

Create a frame which has an option button array for each of the following programs. Make sure that all option buttons have a default value of false at startup. Output the result to a label or picture box as required. A change in any text box should reset all option button values to false, clear the label and make the picture box not visible.

  1. Use text boxes to input (x1, y1) and (x2, y2) for two pair of points in the coordinate plane (all values of x & y will be in the range of -10 to 10).
  2. There should be one option button in the array for each of the following problems.
    1. Find the equation of the line through the points (x1, y1) and (x2, y2) (Recall that slope may be undefined!).
    2. Find the midpoint of the line segment from (x1, y1) to (x2, y2).
    3. Find a center and radius of the circle with the endpoints of the diameter at (x1, y1) and (x2, y2).
    4. Make a picture box visible and draw a coordinate grid with scale tick marks every one unit. Label the tick marks in units of 5. Draw the line segment from (x1, y1) to (x2, y2).. The output should be as below.

 

Visual Basic Assignment Page

 
51928

 

 
© 2004-2008, Jerel L. Welker
Page Updated: January 15, 2009