# GH_CustomButton class

Namespace: [Grasshopper.GUI](https://developer.rhino3d.com/api/gh1/namespace/grasshopper.gui.md) · Assembly: [Grasshopper](https://developer.rhino3d.com/api/gh1/assembly/grasshopper.md)

```cs
public class GH_CustomButton : GH_ISerializable
```

The GH_CustomButton class maintains all information needed for user-defined UI buttons.

## Properties

- [Description](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/description.md): Gets or sets the description for this button. The description is typically used in the tooltip.
- [Icon](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/icon.md): Gets or sets the icon for this button. The icon should be 24x24 pixels.
- [Name](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/name.md): Gets or sets the name of the Custom Button.
- [RequireCode](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/requirecode.md): Gets or sets the requirement filter code for this button. The RequireCode must be a compilable VB.NET class that inherits from Grasshopper.GUI.GH_CustomButtonRequireFilter
- [RequireCodeInstance](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/requirecodeinstance.md): Gets the cached RequireCode instance. If there is no instance yet, it will be compiled.
- [RequireDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/requiredocument.md): Gets or sets whether the button requires a document to exist before it will be enabled. This property is only used when the UseCustomRequirementCode property is set to False.
- [RequireObjects](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/requireobjects.md): Gets or sets whether the button requires at least one object to exist before it will be enabled. This property is only used when the UseCustomRequirementCode property is set to False.
- [RequireSelection](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/requireselection.md): Gets or sets whether the button requires at least one object to be selected before it will be enabled. This property is only used when the UseCustomRequirementCode property is set to False.
- [RunCode](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/runcode.md): Gets or sets the runcode for this button. The runcode must be a compilable VB.NET class that inherits from Grasshopper.GUI.GH_CustomButtonRunCode
- [RunCodeInstance](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/runcodeinstance.md): Gets the cached RunCode instance. If there is no runcode instance yet, it will be compiled.
- [UseCustomRequirementCode](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/usecustomrequirementcode.md): Gets or sets whether the custom requirement code should be used.

## Methods

- [Read](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/read.md)
- [Write](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-custombutton/write.md)
