프로젝트
에 System.Windows.Forms 및 WindowsFormsIntegration에 대한 참조를 추가 : 여기
은 (쉽게 사용자 지정 컨트롤을 사용하여 수정할 수 있습니다) 마스크 텍스트 상자를 사용하는 방법의 예
xmlns:WinForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:WindowsFormsIntegration="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
그리고 장소 윈도우 창에 호스트를 형성한다.
<WindowsFormsHost Name="wfhDate"
HorizontalAlignment="Center"
VerticalAlignment="Stretch">
<WinForms:FlowLayoutPanel/>
</WindowsFormsHost>
지금 C# 코드에
using Forms = System.Windows.Forms;
.........................
Forms.FlowLayoutPanel flpPanel = this.wfhDate.Child as Forms.FlowLayoutPanel;
// Initialize your Forms contol here.
flpPanel.Controls.Add(yourControl);
나는 정확하게이 코드를 시도했고 위에서 언급 한 것과 같은 오류가 발생했습니다. – Shizam
References 폴더에있는'System.Windows.Forms' 어셈블리에 대한 참조를 추가 했습니까? – Kredns
예, 참조 폴더에 추가했습니다. 일부 주변을 둘러보고 연결된 페이지로 돌아와 위 페이지가 XAML 대신 C#을 사용하여 WF 컨트롤을 추가하는 방법을 보여줍니다. WPF 웹 응용 프로그램을 수행 할 때 어떤 이유로 든 XAML을 통해 작동하도록 할 수는 없지만 C#을 통해 수행 할 수 있습니다. http://msdn.microsoft.com/en-us/library/ms751761.aspx – Shizam