Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. FileNameEditor attribute

FileNameEditor attribute

Scheduled Pinned Locked Moved Visual Basic
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cnurse
    wrote on last edited by
    #1

    _ Public Property ImageDir() As String Why wont the above compile? I have tried to implement the FileNameEditor attribute so presumably I can have properties where the user can select files. But it can't find the attribute even though I have imported the documented name space. Any ideas. Nursey

    D 1 Reply Last reply
    0
    • C cnurse

      _ Public Property ImageDir() As String Why wont the above compile? I have tried to implement the FileNameEditor attribute so presumably I can have properties where the user can select files. But it can't find the attribute even though I have imported the documented name space. Any ideas. Nursey

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Found it -- I'm using this code snippet to test:

      Imports System.ComponentModel
      Imports System.Windows.Forms.Design
      'EditorAttribute(GetType(System.Windows.Forms.Design.FileNameEditor), GetType(System.Drawing.Design.UITypeEditor))' _
      Public Property testFilename() As String

      You also have to add a reference to System.Design.dll to get it to show up. It drove me nuts for 20 minutes trying to find it. I finally went into the Object Browser, hit the search button, and typed in 'FileNameEditor' in the 'Find What:' box. Then I clicked on the little button next to 'Look In: Selected Components', clicked on 'External Components and Libraries', and then clicked 'Add'. I then added ALL of the 'System..dll' files, hit 'Select', then 'OK'. I did the search and found the little bugger under System.Windows.Forms.Design. I then went thru the 'External Components' list again and 'Remove'd each external component, one at a time, until the Browser window no longer showed the 'FileNameEditor' hit. That's when I knew what DLL it was residing in. RageInTheMachine9532

      C 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Found it -- I'm using this code snippet to test:

        Imports System.ComponentModel
        Imports System.Windows.Forms.Design
        'EditorAttribute(GetType(System.Windows.Forms.Design.FileNameEditor), GetType(System.Drawing.Design.UITypeEditor))' _
        Public Property testFilename() As String

        You also have to add a reference to System.Design.dll to get it to show up. It drove me nuts for 20 minutes trying to find it. I finally went into the Object Browser, hit the search button, and typed in 'FileNameEditor' in the 'Find What:' box. Then I clicked on the little button next to 'Look In: Selected Components', clicked on 'External Components and Libraries', and then clicked 'Add'. I then added ALL of the 'System..dll' files, hit 'Select', then 'OK'. I did the search and found the little bugger under System.Windows.Forms.Design. I then went thru the 'External Components' list again and 'Remove'd each external component, one at a time, until the Browser window no longer showed the 'FileNameEditor' hit. That's when I knew what DLL it was residing in. RageInTheMachine9532

        C Offline
        C Offline
        cnurse
        wrote on last edited by
        #3

        Sir Rage of Rage-shire, thou art a God! P*sser number 1...when the System.Design shows up with other stuff, like it's already referenced. Things like that just lower your trust of things you take for granted as being straight forward. Ah well, onwards and upwards. Oh by the way...I solved my problem of icons for my controls not showing up in the toolbox. I renamed my controls, to divorce them of any old stuff in the registry, and guess what, yep, you don't have that surprised look on your face, so you know...it worked! P*sser number 2, follow the rules but if your registry is strangely screwed for whatever reason then its gonna bite yah! 8-( As soon as I referenced system.design explicitly the new uitype designer stuff was all plugged in. Thanks a million! Nursey

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups