2008/09/03

Event Handler in VB.NET/C#

I am using VB.NET at work, but currently most of the tutorials for learning Silverlight taught in C#. I am not that familiar with C#, although I understand other similar programming language such as Java. As a result, I need to write it down for looking up in the future.

Event Handler Syntax in VB/C#:

Bold: Event Name
Bold Itatlic: Event Function

VB Syntax:

AddHandler wcService.DownloadStringCompleted, AddressOf wcService_DownloadStoriesCompleted


C# Syntax:

wcService.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wcService_DownloadStoriesCompleted);

沒有留言: