question

Zaug-0766 avatar image
0 Votes"
Zaug-0766 asked Zaug-0766 commented

MenuStrip Not visible

I am work with wpf on visual studio 2019.
menu strip is not intended, menustrip is not available in toolbox.
not included as code
how is your design?? (I'm new to wpf)

windows-wpf
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Zaug-0766
Welcome to Microsoft Q&A platform, this is an English platform. Please translate your question to English.

0 Votes 0 ·

translated

0 Votes 0 ·

1 Answer

DaisyTian-1203 avatar image
0 Votes"
DaisyTian-1203 answered Zaug-0766 commented

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.dllSystem.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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thx , for solving

0 Votes 0 ·