Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load Dim oPrinter As New Printer(Printer.PrinterType.HP) oPrinter.Print() End Sub End Class Public Class Printer Public Enum PrinterType HP Epson End Enum Public ActivePrinter As PrinterType Public Sub New(ByVal mPrinterType As PrinterType) ActivePrinter = mPrinterType End Sub Public Sub Print() Select Case ActivePrinter Case PrinterType.HP HP_Printer.Print() Case PrinterType.Epson Epson_Printer.Print() End Select End Sub End Class Public Class HP_Printer Public Shared Sub Print() Beep() End Sub End Class Public Class Epson_Printer Public Shared Sub Print() Beep() End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)