Name of field or Property being initialized in an Object initializer must start with '.'

Asked

Viewed 52 times

3

Give me the error:

The name of the field or property being initialized on an object initializer must start with '.'.

 Private myImageList As System.Windows.Forms.ImageList = New ImageList()
    Private myImageListSmall As System.Windows.Forms.ImageList = New ImageList()
    Private myImageListLarge As System.Windows.Forms.ImageList = New ImageList()
    Private count As Integer = 0
    Private ofd As New OpenFileDialog() With { _
        Key .Multiselect = True, _
        Key .ValidateNames = True, _
        Key .Filter = "JPG|*jpg|JPEG|*.jpeg|PNG|*.png" _
    }
    Private fi As FileInfo
  • You’re on Stackoverflow in portuguese, translate your question or perform it on Soen

  • @Guilhermecostamilam thank you for warning us so and so;to work with Englishmen all the time

1 answer

3


This Key then it doesn’t make any sense, just take it off:

Private myImageList As System.Windows.Forms.ImageList = New ImageList()
Private myImageListSmall As System.Windows.Forms.ImageList = New ImageList()
Private myImageListLarge As System.Windows.Forms.ImageList = New ImageList()
Private count As Integer = 0
Private ofd As New OpenFileDialog() With { _
    .Multiselect = True, _
    .ValidateNames = True, _
    .Filter = "JPG|*jpg|JPEG|*.jpeg|PNG|*.png" _
}
Private fi As FileInfo

I put in the Github for future reference.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.