How to put a custom windows forms control in a WPF application?

前端 未结 3 1255
不思量自难忘°
不思量自难忘° 2021-01-01 02:18

As a short term solution I\'m trying to jam a windows form \'usercontrol\' into a WPF application. I see in the WPF application view that I can add a \'custom windows form

3条回答
  •  囚心锁ツ
    2021-01-01 02:26

    You can't really add it as a control to the toolbox like you could for a Windows Forms Application. What you should do instead is "host" the user control inside of the WPF application.

    See how to do it on MSDN.

    Here's an example of how to use a masked text box (which you can easily modify to use your custom control):

    
    
        
           
        
    
    
    

提交回复
热议问题