Module Module1 'declare a struct named Colour Public Structure Colour 'Properties Public Property Red As Integer Public Property Green As Integer Public Property Blue As Integer 'Constructor Public Sub New(ByVal rVal As Integer, ByVal gVal As Integer, ByVal bVal As Integer) Red = rVal Green = gVal Blue = bVal End Sub 'Display the Struct as a String Public Overrides Function ToString() As String Return String.Format("{0}, {1}, {2}", Red, Green, Blue) End Function End Structure Public Class Tester Public Sub Run() 'Create an instance of the struct Dim colour1 As Colour = New Colour(100, 50, 250) 'Display the values in the struct Console.WriteLine("colour1 colour: {0}", colour1) 'Invoke the default constructor Dim colour2 As Colour = New Colour() Console.WriteLine("colour2 colour: {0}", colour2) 'Pass the struct to a method MyMethod(colour1) 'Redisplay the values in the struct Console.WriteLine("colour1 colour: {0}", colour1) End Sub 'Method takes a struct as a parameter Public Sub MyMethod(ByVal col As Colour) 'Modify the values through the properties col.Red = 200 col.Green = 100 col.Blue = 50 Console.WriteLine("colour1 colour: {0}", col) End Sub End Class Sub Main() Dim t As Tester = New Tester() t.Run() Console.ReadLine() End Sub End Module