C# Winform example with property pages


https://www.nevron.com/Forum/Topic7655.aspx
Print Topic | Close Window

By Jarrett Robertson - 11 Years Ago
In the examples->All Examples->User Interface->Editors available at runtime you show a property page that has line properties that launch the NStrokeStyleTypeEditor. When I looked at the source code it doesn't show the property pages. Is there a way for me to achieve this same effect of embedding that form? I tried the standard way of using property pages but I wasn't able to get it to work.

Any help would be appreciated.
By Nevron Support - 11 Years Ago
Hello Jarrett,

To be able to display NStrokeStyleTypeEditor when an object which has property of type NStrokeStyle is put in a PropertyGrid you need to set Editor attribute to this property which specifies the editor.
Here is an example class.

public class Test
{
   [Editor(typeof(NStrokeStyleTypeEditor), typeof(UITypeEditor))]
   public NStrokeStyle StrokeStyle
   {
      get
      {
         return m_StrokeStyle;
      }
      set
      {
         m_StrokeStyle = value;
      }
   }

   private NStrokeStyle m_StrokeStyle;
}

I hope this helps.
By Jarrett Robertson - 11 Years Ago
Sorry for the late reply. I recently was able to implement the code you suggested and it worked great. Thank you!