Skip to content

MenuCheckboxItem

A menu item with ‘checkbox’ functionality and a forced checkbox icon on the right.


// checkedValue: when this is set to true, the checkbox will be 'checked' by default.
bool checkedValue = false;
MenuCheckboxItem item = new MenuCheckboxItem("Checkbox Text", "Checkbox description.", checkedValue);
// Set the style:
item.Style = CheckboxStyle.Tick;
// Add a menu item to a menu:
menu.AddMenuItem(item);

Toggling a checkbox raises the OnCheckboxChange event on its parent menu. Checked has already been updated by the time your handler runs, and the newCheckedState parameter holds the same value.

MenuCheckboxItem godMode = new MenuCheckboxItem("God mode", "Makes you invincible.", false);
menu.AddMenuItem(godMode);
menu.OnCheckboxChange += (_menu, _item, _index, _checked) =>
{
if (_item == godMode)
{
SetEntityInvincible(PlayerPedId(), _checked);
}
};

Disabled checkboxes are greyed out and can not be toggled, which is useful for showing a state the user is not allowed to change.

menu.AddMenuItem(new MenuCheckboxItem("Premium feature", "Only available to donators.", false)
{
Enabled = false,
LeftIcon = MenuItem.Icon.LOCK
});


Creates an unchecked checkbox without a description.

Parameter Type Description
text string The text displayed on the left side of the item.

Section titled “MenuCheckboxItem(string text, bool _checked)”

Creates a checkbox without a description, with the given checked state.

Parameter Type Description
text string The text displayed on the left side of the item.
_checked boolean The initial checked state.

Section titled “MenuCheckboxItem(string text, string description)”

Creates an unchecked checkbox with a description.

Parameter Type Description
text string The text displayed on the left side of the item.
description string The description shown below the menu while this item is selected.

Section titled “MenuCheckboxItem(string text, string description, bool _checked)”

Creates a checkbox with a description and the given checked state.

Parameter Type Description
text string The text displayed on the left side of the item.
description string The description shown below the menu while this item is selected.
_checked boolean The initial checked state.

Property Type Default value Description Optional
Checked boolean false The checked state for the checkbox. No
Style CheckboxStyle CheckboxStyle.Tick The style of this checkbox item when it is “checked”. No

There are no methods available for MenuCheckboxItems.


Available checkbox syltes:

Style Available in which game? Default style Example
CheckboxStyle.Tick FiveM & RedM Yes Style