Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Time to get our hands dirty and create a structure. We’ll stub it out in the Class Designer and then complete the code in the Editor.
0 Create a new Class Library project. You can close the Class1.VB file that Visual Studio creates by default; we won’t be using it.
1 Add a new class diagram to the project. From the Toolbox, drag a Struct onto the Diagram pane. The Designer will display the New Struct dialog. It’s almost identical to the New Class dialog we worked with in the last chapter. Change the name to FirstStructure and click the OK button.
2 The Class Details pane for a structure looks just as it did when you added a class, too. (Visual Studio doesn’t even change the name!) That’s because the main difference between a class and a structure when you’re creating the definition is that a structure always inherits directly from System.ValueType.