System.Windows.Forms.MenuStrip is a WinForm control. In WPF, we use System.Windows.Controls.Menu control. If you still want to use MenuStrip
in WPF, you can implement it as below steps:
1.
Add two dll WindowsFormsIntegration.dll
,System.Windows.Forms.dll
for the WPF project.
2.
Add below code to your XAML:
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
3.
Then you can use it like:
<wfi:WindowsFormsHost Width="200" Height="50">
<wf:MenuStrip x:Name="wfLabel" Text="winForm MenuStrip" Width="120" Height="50"/>
</wfi:WindowsFormsHost>
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
translated