tailieunhanh - Programming HandBook part 85
Tham khảo tài liệu 'programming handbook part 85', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Public Property Year As Integer Get Return year End Get Set year value End Set End Property Private year As Integer get return year set year value mt ye ar Public Function IsLeapYear year As Integer As Boolean Returndi year Hod 4 0 Then True Else False End Function IsLeapYear Public Sub SetDate day As Integer Bonth As Integer year As Integer Ke. day day month year End Sub SetDate End Class Date public bool IsLeapYear int year return year 4 0 true false public void SetDate int day mt month int year 1 day month year Delegates Events Delegate Suh HsgArrivedEventHandler ByVai message As String Event HsgArrivedEvent AS Hs gAr r ive dEvent Handle r or to define an event which declares a delegate implicitly Event HsgArrivedEvent ByVai message As String AddHandler HsgArrivedEvent AddressOf Hy_HsgAr r ive dCallh ack cn t throw an exception if oh1 is Nothing RaiseEvent HsgArrivedEvent Test message RemoveHandler HsgArrivedEvent AddressOf Hy_Ks gAr r i ve dC al a ck Imports 1WithEvents can t he used on local variable Dim WithEvents HyButton As Button HyButton New Button Private Suh HyButton_Click ByVai sender As _ ByVai e As System. Event Args HyButton. Click He Button was clicked Info He s s ag eB o xButt ion End Sub C delegate void HsgArrivedEventHandler string message event HsgArrivedEventHandler Hs gAr r ivedEvent Delegates must be used with events in HsgArrivedEvent new Hs gAr r ivedEventHandler Hy_HsgArrivedEventCallback Throws exception if obj is null HsgArrivedEvent Test message HsgArrivedEvent - new Hs gAr r ivedEventHandle r Hy _HsgArrivedEventCallback using Button HyButton new Button new HyB utt on_Click private void HyButton_Click object sender. e this Button was clicked tnfc HessageBoxEutt .
đang nạp các trang xem trước