Download CustomTypeConverter1.zip version 1.0.0.0, last updated 28/07/2013 (12.74 KB)

Download
  • md5: b750911ae2f67565a562ace5615f3f06
using System;
using System.Windows.Forms;

/*
  Custom Type Converter Sample 1
  http://cyotek.com/blog/creating-a-custom-typeconverter-part-1
*/

namespace CustomTypeConverter1
{
  internal partial class MainForm : Form
  {
    #region Instance Fields

    private SampleClass _sample;

    #endregion

    #region Constructors

    public MainForm()
    {
      InitializeComponent();
    }

    #endregion

    #region Overridden Members

    protected override void OnLoad(EventArgs e)
    {
      base.OnLoad(e);

      _sample = new SampleClass
      {
        Length1 = new Length
        {
          Value = 32F,
          Unit = Unit.px
        }
      };

      propertyGrid.SelectedObject = _sample;
    }

    #endregion

    #region Event Handlers

    private void exitToolStripMenuItem_Click(object sender, EventArgs e)
    {
      this.Close();
    }

    #endregion
  }
}

Donate

Donate