im creating a custom User Control. its a custom picture box . i want to user to select the picture file from file system. so i use following code(i found it on a forum) . but vb says that code has a error . help me :'(

<EditorAttribute(GetType(System.Windows.Forms.Design.FileNameEditor), _
    GetType(System.Drawing.Design.UITypeEditor))> _

Error - type 'System.Windows.Forms.Design.FileNameEditor' is not defined


full property code

<Category("Image Path")> _
    <Browsable(True)> _
   <EditorAttribute(GetType(System.Windows.Forms.Design.FileNameEditor), _
    GetType(System.Drawing.Design.UITypeEditor))> _
    Public Property file_D() As String
        Get

            Return path
        End Get
        Set(ByVal value As String)
            path = value


            If String.IsNullOrEmpty(path) Then

                PictureBox1.ImageLocation = path

            End If

            Me.Invalidate()
        End Set
    End Property

i found the answer
i forget to include System.Design to my project reference :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.