Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I would like to know how to get a property that lets me pick a text file at design time from the property list. In other words you get the button with the ... in it and it opens the OpenFile dialog.

 

Also since I have never had to save a custom property in a usercontrol before.... how do I go about saving that filename so that it is the default when the app is compiled and run?

 

I know the first part has to do with the Designer class... not sure on the other one though.

"Programmers are tools for converting caffeine into code."

 

Madcow Inventions -- Software for the Sanity Challenged.

  • *Gurus*
Posted

Use this attribute on your property:

 

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

 

The designer will take care of serialization of your property automatically.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...