The type '<type name>' has no field named '<field name>'

The type specified in the error message has no field of that name. The following code example demonstrates a type with an unsupported field name:

Form1.FormBorderstyle = Automobile
form1.FormBorderstyle = Automobile;

To correct this error

  • Use a field that is supported by that type. In reference to the previous code example, code similar to the following is appropriate.

    Dim mainForm as new Form
    mainForm.FormBorderStyle = _ 
        System.Windows.Forms.FormBorderStyle.FixedDialog
    
    Form mainForm = new Form();
    mainForm.FormBorderStyle = 
        System.Windows.Forms.FormBorderStyle.FixedDialog;
    

See Also

Reference

enum (C# Reference)

Concepts

Enumerations Overview (Visual Basic)