代码之家  ›  专栏  ›  技术社区  ›  Ray Li

更改C中的ContextMenu字体大小#

  •  4
  • Ray Li  · 技术社区  · 17 年前

    对于桌面应用程序,是否可以使用.NET Framework 3.5和C更改ContextMenu中使用的字体大小?这似乎是一个系统范围的设置,但我只想在我的应用程序中更改它。

    4 回复  |  直到 17 年前
        1
  •  6
  •   OwenP    17 年前

    ContextMenuStrip

    ContextMenu

    TextBox

        2
  •  1
  •   Hallgrim    17 年前

        3
  •  1
  •   Ben Straub    17 年前

    <Window.ContextMenu FontSize="36">
        <!-- ... -->
    </Window.ContextMenu
    

    contextMenuStrip1.Font = new System.Drawing.Font("Segoe UI", 24F);
    
        4
  •  0
  •   Isak Savo    17 年前

    <Whatever.ContextMenu TextBlock.FontSize="12">
      <MenuItem ... /> <!-- Will get the font size from parent -->
    </Whatever.ContextMenu>
    

    <Style TargetType="MenuItem">
       <Setter Property="TextBlock.FontSize" Value="12" />
    </Style>