FileNameEditor attribute
-
_ 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
-
_ 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
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 StringYou 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
-
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 StringYou 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
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