O'Reilly logo

Joy of Patterns: Using Patterns for Enterprise Development, The by Brandon Goldfedder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

AccountForm

 Option Explicit Dim observer As FormAccountObserver Public Sub update(modifiedAccount As Account) Dim currentEntry As accountEntry lstEntries.Clear For Each currentEntry In modifiedAccount.getEntries lstEntries.AddItem (currentEntry.entryDate & vbTab & currentEntry.amount) Next End Sub Private Sub cmdAdd_Click() Call testAccount.addEntry(txtDate, txtAmount) Call update(testAccount) End Sub Private Sub cmdSpawn_Click() Dim frm As New frmAccount frm.Show End Sub Private Sub cmdSync_Click() testAccount.notify End Sub Private Sub Form_Load() txtDate = Now() Set observer = New FormAccountObserver Call observer.setForm(Me) Call testAccount.attachObserver(observer, CStr(Me.hWnd)) Call update(testAccount) End Sub Private Sub Form_Unload(Cancel ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required