Adding a NumericUpDown instance to a Canvas instance
I need to create a dynamic dialog box using System.Windows.Window class where the controls being displayed inside this dialog will change at runtime. Therefore I am using a System.Windows.Controls.Canvas instance and then adding controls to the Children property of the Canvas instance.
However I need a System.Windows.Forms.NumericUpDown instance in the dialog box but I cant add it to the Children property of the Canvas instance as the System.Windows.Forms.NumericUpDown class is not inherited from the System.Windows.UIElement class.
Does anybody have any idea how the System.Windows.Forms.NumericUpDown instance can be added to the Children property of the System.Windows.Controls.Canvas class?
Or is there a class, that is similar to the System.Windows.Forms.NumericUpDown class, which is inherited from the System.Windows.UIElement class?
Re: Adding a NumericUpDown instance to a Canvas instance
You basically have two options: Either use interop for embedding an existing WinForms control like NumericUpDown into a WPF app (discouraged, complicated, tedious, unelegant), or simply reproduce the control as a WPF control... Either roll your own, or take a look at this: http://msdn.microsoft.com/en-us/library/ms771573.aspx