 |
|
 |
|
Location: Blogs Andy's Blog |
|
| Posted by: host |
11/16/2005 8:58 PM |
Here are some notes for the CBIT 2373 class on handling multiple click events in one event handler -
Private m_nFirstValue As Decimal = -1 Private m_nSecondValue As Decimal = -1
Private Sub ButtonAny_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click, Button5.Click, Button6.Click, Button7.Click, Button8.Click, Button9.Click, Button12.Click txtResult.Text &= CType(sender, Button).Text End Sub
Private Sub btnPlus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlus.Click m_nFirstValue = CType(txtResult.Text, Decimal) txtResult.Text = "" End Sub
Private Sub btnEquals_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEquals.Click m_nSecondValue = CType(txtResult.Text, Decimal) txtResult.Text = m_nFirstValue + m_nSecondValue End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click txtResult.Text = "" m_nFirstValue = -1 m_nSecondValue = -1 End Sub |
|
| Permalink |
Trackback |
|
|
 |
|
 |
|
|