MenuStrip Not visible

Zaug 306 Reputation points
2021-06-23T06:21:55.943+00:00

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 Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,666 questions
{count} votes

Accepted answer
  1. DaisyTian-1203 11,616 Reputation points
    2021-06-25T09:30:10.173+00:00

    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.


0 additional answers

Sort by: Most helpful