I want to create a Menu bar in WFP Form, so that I dont write the same code on every page, How can I do that?
I want to create a Menu bar in WFP Form, so that I dont write the same code on every page, How can I do that?
You can create the Meun Bar in a UserControl, then use it the page which need the Meun Bar.
For example, you can create a UserControl named MyMenuBar like below:
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="_Open"/>
<MenuItem Header="_Close"/>
<MenuItem Header="_Save"/>
</MenuItem>
</Menu>
<StackPanel></StackPanel>
</DockPanel>
Then you can use it in Window1 like below: <local:MyMenuBar></local:MyMenuBar>
The Window1 will show the Meun Bar. Did I misunderstand your question? If I did, could you give me more description of your question for me to anlyze.
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.
Thank You @DaisyTian-MSFT , you have understood my query perfectly and has provided the perfect answer.
7 people are following this question.