MenuItem.SetFontSize
--------------------

Sets the font size to use.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Menu](component_Menu.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "MenuItem.SetFontSize"; Item; FontSize ) 

**MBS**( **"MenuItem.SetFontSize";** /\* Sets the font size to use. \*/  
**$Item**; /\* The reference to the menu item. Please create one with [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md) or [MenuItem.CreateSeparator](MenuItemCreateSeparator.md). \*/   
**$FontSize**) /\* The font size to use. Use 0 for default system font size.e.g. 9 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Item | The reference to the menu item. Please create one with [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md) or [MenuItem.CreateSeparator](MenuItemCreateSeparator.md). | $item |
| FontSize | The font size to use. Use 0 for default system font size. | 9 |

### Result

Returns OK or error.

### Description

Sets the font size to use.  
### Examples

Creates a menu item with a font size:

 Set Variable \[$item ; Value:MBS ("[MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md)"; "Font Size 20")\]  
Set Variable \[$r ; Value:MBS ("MenuItem.SetFontSize"; $item ; 20)\]  
Set Variable \[$r ; Value:MBS ("[Menu.AddItem](MenuAddItem.md)"; $menu ; $item )\]  
Loop over all menuitems in a menu and change font size:

 While (   
\[  
 // get items in menu   
 items = MBS ( "[Menu.Items](MenuItems.md)"; $menu );   
 index = 1;  
 count = MBS ( "[Menu.NumberOfItems](MenuNumberOfItems.md)"; $menu )  
\] ;   
  
// loop till last item  
index ≤ count ;   
  
\[   
 // get the current item  
 item = GetValue(items; index);  
 // change font size  
 r = MBS ( "MenuItem.SetFontSize"; item; 16 );   
 // and continue with next item  
 index = index + 1  
\] ; 0 )  
### See also

- [Menu.AddItem](MenuAddItem.md)
- [Menu.Items](MenuItems.md)
- [Menu.NumberOfItems](MenuNumberOfItems.md)
- [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md)
- [MenuItem.CreateSeparator](MenuItemCreateSeparator.md)
- [MenuItem.GetFontName](MenuItemGetFontName.md)
- [MenuItem.GetFontSize](MenuItemGetFontSize.md)
- [MenuItem.SetFontColor](MenuItemSetFontColor.md)
- [MenuItem.SetFontName](MenuItemSetFontName.md)

### Example Databases

- [Menu/Popup Menu](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Menu/Popup%20Menu.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 5.1pr8](https://www.mbsplugins.de/archive/2015-05-13/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [More menu commands for FileMaker](https://www.mbsplugins.de/archive/2015-05-11/More_menu_commands_for_FileMak/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2021, Seite 29](https://filemaker-magazin.de/neuigkeit/4132-Appetithappen-FMM_202102)

This function is free to use.

Created 11st May 2015 , last changed 12nd March 2021

  
[MenuItem.SetFontName](MenuItemSetFontName.md) - [MenuItem.SetGroupID](MenuItemSetGroupID.md)

[HTML Version](MenuItemSetFontSize.shtml)