Public Class Class1 Public Function Test() As Boolean Return True End Function End Class Public Class Class2 Inherits Class1 <Obsolete()> _ <System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)> _ Public Shadows Function Test() As Boolean Throw New ApplicationException("Fonction non autorisée") End Function End Class
Public Class Class1 Public Function Test() As Boolean Return True End Function End Class Public Class Class2 Inherits class1 Public Shadows Function Test() As Boolean Throw New ApplicationException("Fonction non autorisée") End Function End Class Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim c1 As New Class1 Dim c2 As New Class2 Try c1.Test() Catch ex As Exception MsgBox("c1 : " & ex.Message) End Try Try c2.Test() Catch ex As Exception MsgBox("c2 : " & ex.Message) End Try End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question<Obsolete()> _ <System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)> _