How to use .NET Windows Control into the WPF Application
1514 단어 application
It is easy to place the Windows Control into the WPF Window. There are very extensive ranges of controls available in Windows, which can be used in WPF application after reading the article.
Steps:
1. Create the WPF Application in visual studio 2008.
2. Make sure you have the reference of WindowsFormsIntegration.dll and System.Windows.Forms.dll.
3. Open the Window1.xaml in the designer.
4. Add the Windows Form namespace as follows
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
NOTE: If you want to any 3rd party control then add its reference to the project and add the namespace for the assembly.
5. Drag and drop the WindowsFormsHost control to Windows1.xaml Window.
6. Write the Xaml code inside the WindowsHost Element as followes
Compile and Run the WPF Application you would see the Windows Control there.
In the source code I user thee WindowsFormsHost, two contain the DateTimePicker and third one contain empty DataGrid.
Summary: If you have already made investment in Windows Form control, you can use those in WPF without any issue.
Reprinted from [http://www.a2zdotnet.com/View.aspx?Id=80#.Ub8hYpyvy3I]
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Pre-Query SamplesValidate the current query criteria or provide additional query criteria programmatically, just before sending the SELEC...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.