Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. window set fontsize question

window set fontsize question

Scheduled Pinned Locked Moved WPF
question
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    econy
    wrote on last edited by
    #1

    Don't know why the Fontsize="14" attribute not works on MenuItem, File,Login,Exit.

    Richard DeemingR 1 Reply Last reply
    0
    • E econy

      Don't know why the Fontsize="14" attribute not works on MenuItem, File,Login,Exit.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Because the default style applied to all Menu controls overrides the font size:

      <Style TargetType="{x:Type Menu}">
      <Setter Property="TextElement.FontSize">
      <Setter.Value>
      <DynamicResource ResourceKey="{x:Static SystemFonts.MenuFontSizeKey}" />
      </Setter.Value>
      </Setter>
      </Style>

      As documented on MSDN[^], values set in a Style override values inherited from parent controls. You either need to set the font size explicitly on the Menu, or create and apply a new Style for the Menu.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      E 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        Because the default style applied to all Menu controls overrides the font size:

        <Style TargetType="{x:Type Menu}">
        <Setter Property="TextElement.FontSize">
        <Setter.Value>
        <DynamicResource ResourceKey="{x:Static SystemFonts.MenuFontSizeKey}" />
        </Setter.Value>
        </Setter>
        </Style>

        As documented on MSDN[^], values set in a Style override values inherited from parent controls. You either need to set the font size explicitly on the Menu, or create and apply a new Style for the Menu.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        E Offline
        E Offline
        econy
        wrote on last edited by
        #3

        Thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups