0% found this document useful (0 votes)
66 views

Exercise 5

The document contains the code for a Windows form with three buttons and menu options that demonstrate associative and commutative algebraic properties by setting the text of a label. Button1 and the Associative menu item set the label to show the associative property of addition. Button2 and the Commutative menu item set the label to show the commutative property of addition. Button3 and the Exit menu item close the form.

Uploaded by

api-310300017
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Exercise 5

The document contains the code for a Windows form with three buttons and menu options that demonstrate associative and commutative algebraic properties by setting the text of a label. Button1 and the Associative menu item set the label to show the associative property of addition. Button2 and the Commutative menu item set the label to show the commutative property of addition. Button3 and the Exit menu item close the form.

Uploaded by

api-310300017
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Label1.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Label1.Text = "(A + B) + C = A +(B+ C)"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Label1.Text = "B + A = A + B"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Close()
End Sub
Private Sub AssociativeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles AssociativeToolStripMenuItem.Click
Label1.Text = "(A + B) + C = A +(B+ C)"
End Sub
Private Sub CommutativeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CommutativeToolStripMenuItem.Click
Label1.Text = "B + A = A + B"
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
Close()
End Sub
End Class

You might also like