'Project: Menu and Dialog Boxes 'Programmer: Andy McCone 'Date: Winter 2008 'Description: This program shows off how to use 'Menus and Dialog Boxes from Chapter 5 Option Strict On Public Class menuDlgForm Inherits System.Windows.Forms.Form Private Sub ExitToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem1.Click ' Exit program Me.Close() End Sub Private Sub AboutToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem1.Click 'Display programmer information MessageBox.Show("Programmed by Andy McCone", "Programmer!", MessageBoxButtons.OK, MessageBoxIcon.Information) End Sub Private Sub changeColorButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles changeColorButton.Click 'open the Color Dialog Box ColorDialog1.ShowDialog() 'Capture color choice by user and apply to helloLabel helloLabel.BackColor = ColorDialog1.Color End Sub Private Sub changeFontButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles changeFontButton.Click 'open the Font dialog box FontDialog1.ShowDialog() 'Capture user font choice and apply to helloLabel helloLabel.Font = FontDialog1.Font End Sub Private Sub FontToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontToolStripMenuItem1.Click 'Call Button click event Call changeFontButton_Click(sender, e) End Sub Private Sub ColorToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ColorToolStripMenuItem1.Click 'Call Button click event Call changeColorButton_Click(sender, e) End Sub End Class