CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2001

    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?

  2. #2
    Join Date
    Sep 2002
    14 39'19.65"N / 121 1'44.34"E

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)