10.7. Generic MethodsType members (functions and sub procedures) can also be defined with type parameters, whether or not the class in which they appear uses generics . The type parameter information appears between the defined method name and its regular parameter list. Public Sub GenericMessage(Of T As System.Windows.Forms.Control) _ (ByVal preamble As String, ByVal someObject As T) MsgBox(preamble & ": " & someObject.Location.ToString( )) End Sub All of the multiple parameter, constraint, and member usage rules that apply to generic classes also apply to generic members. |