locked
MenuItem question RRS feed

  • Question

  • Hi
    I have a Menu with MenuItems.  For a MenuItem there is many child items.  For example the File menu, contains Open, Save, etc.

    Is there a way to detect the item first in the menu in Xaml?
    In the example I would like to give Open another background color.

    //lasse
    Lasse
    Sunday, November 1, 2009 7:04 PM

Answers

  • Hi Lasse,

    MenuItem has a Background property, just set it.

      <Menu>
                <MenuItem Header="File">
                    <MenuItem Header="Open" Background="Red"/>
                    <MenuItem Header="Save"/>
                </MenuItem>
            </Menu>

    Best Regards,
    Zhi-Xin


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by Zhi-Xin Ye Tuesday, November 10, 2009 1:54 PM
    Friday, November 6, 2009 10:33 AM