Menu Item color change in wpf
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Thread: Menu Item color change in wpf

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Posts
    9

    Menu Item color change in wpf

    Hi ,

    I have attaached with my project window menu bar for review .

    When i selected menu item its highlited with blue color .i dont want that color bec my req is like that.
    Please send me reply asap. bec its very urgent for me.

    please review the attachment.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    18 32' N / 73 52' E
    Posts
    416

    Re: Menu Item color change in wpf

    Put Background as white: something like this.

    Code:
    <MenuItem x:Name="mnuFile" Header="File" Background="White" Foreground="SteelBlue"/>
    It will remove Blue hovering effect.
    I hope this is what you want.
    Regards,
    MMH
    Rate my post if you find it usefull.

  3. #3
    Join Date
    Apr 2009
    Posts
    9

    Re: Menu Item color change in wpf

    Thanks for your reply and its not working for me.please let me know.

  4. #4
    Join Date
    Jan 2006
    Location
    18 32' N / 73 52' E
    Posts
    416

    Re: Menu Item color change in wpf

    Quote Originally Posted by syr View Post
    Thanks for your reply and its not working for me.please let me know.
    Can you paste the lines of code that you have coded for menu item ?

  5. #5
    Join Date
    Apr 2009
    Posts
    9

    Re: Menu Item color change in wpf

    Please check the following code.Thanks for your fast reply.

    <Menu Margin="12,0,0,0" Name="menuManageData" Height="26" VerticalAlignment="Top" Background="White" HorizontalAlignment="Left" Width="302">
    <MenuItem Header="Search For Form" Click="SearchFrm_Click" Foreground="#FF0093BD" ForceCursor="True" Background="White" FontFamily="Arial" OverridesDefaultStyle="False" Focusable="True" HeaderStringFormat="Bold" />
    <MenuItem Header="Search and Replace" Click="SearchReplace_Click" Foreground="#FF0093BD" FontFamily="Arial" />
    <MenuItem Header="Add New Form" Foreground="#FF0093BD" Click="AddNewFrm_Click" Background="White" FontFamily="Arial" />
    </Menu>

  6. #6
    Join Date
    Jan 2006
    Location
    18 32' N / 73 52' E
    Posts
    416

    Re: Menu Item color change in wpf

    Quote Originally Posted by syr View Post
    Please check the following code.Thanks for your fast reply.

    <Menu Margin="12,0,0,0" Name="menuManageData" Height="26" VerticalAlignment="Top" Background="White" HorizontalAlignment="Left" Width="302">
    <MenuItem Header="Search For Form" Click="SearchFrm_Click" Foreground="#FF0093BD" ForceCursor="True" Background="White" FontFamily="Arial" OverridesDefaultStyle="False" Focusable="True" HeaderStringFormat="Bold" />
    <MenuItem Header="Search and Replace" Click="SearchReplace_Click" Foreground="#FF0093BD" FontFamily="Arial" />
    <MenuItem Header="Add New Form" Foreground="#FF0093BD" Click="AddNewFrm_Click" Background="White" FontFamily="Arial" />
    </Menu>
    Hi, Can you tell me whether setting Background = "White" for menuItem works? or doent not work completely?

    In your code i found that, for 2nd menuItem Background="White" is missed out.

    Please check it. I have tested this in both VS2008 and VS2008 EE.
    Regards,
    MMH
    Rate my post if you find it usefull.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center