# Canvas class

Namespace: [Grasshopper2.UI.Canvas](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.canvas.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class Canvas : FlexControl
```

Canvas control for hosting Grasshopper documents.

## Constructors

- [Canvas](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/ctor.md): Create a new canvas control.

## Fields

- [ThumbnailHeight](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/thumbnailheight.md): (static) The default height of document thumbnail images.
- [ThumbnailWidth](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/thumbnailwidth.md): (static) The default width of document thumbnail images.

## Properties

- [AllowedActions](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/allowedactions.md): Access the set of allowed actions on a canvas. It is highly recommended to never change these settings on a canvas which you (the developer) did not create.
- [CurrentlyDrawingCanvas](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/currentlydrawingcanvas.md): (static) Gets the canvas which is currently drawing itself. Due to the non-concurrent nature of UI framework updates it's a fair bet that only one control at any given time is being drawn. However, if you need this property to make code work the way it was intended, it's an indication something has been poorly designed.
- [CursorEditActive](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/cursoreditactive.md): (static) Gets the default cursor used for active edit mode.
- [CursorEditArmed](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/cursoreditarmed.md): (static) Gets the default cursor used for armed edit mode.
- [CursorMode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/cursormode.md): Gets the current high-level cursor mode. Setting this property updates the displayed cursor as a side effect, ensuring the on-screen cursor always matches the logical state.
- [CursorQuestion](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/cursorquestion.md): (static) Gets the default question mark cursor used for component lookup.
- [CursorWireIn](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/cursorwirein.md): (static) Gets the default cursor used for input grips.
- [CursorWireOut](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/cursorwireout.md): (static) Gets the default cursor used for input grips.
- [Document](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/document.md): Gets or sets the document displayed in this canvas. This will never return null as a new document is created on an is-needed basis.
- [FullFrameDuration](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/fullframeduration.md)
- [GridDuration](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/gridduration.md)
- [IconDuration](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/iconduration.md)
- [InNestedNavigationMode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/innestednavigationmode.md): Gets whether this canvas is currently in nested navigation mode. That is, whether current modifiers are either SHIFT or CTRL+SHIFT.
- [LayoutDuration](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/layoutduration.md)
- [RedrawOnMouseMove](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/redrawonmousemove.md): Gets or sets whether the canvas needs to trigger a redraw on every mouse-move event. Note that this field is set to false on every redraw, so it must be assigned anew every time.
- [ShapeDuration](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/shapeduration.md)
- [ShowTilesWhenEmpty](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/showtileswhenempty.md): Gets whether or not tiles are shown when the canvas contains an empty document.
- [ShowUndoHistory](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/showundohistory.md): Gets or sets whether the undo history browser ought to be displayed.
- [Skin](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/skin.md): Gets the skin to use in this canvas.
- [SkinDim](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/skindim.md): Gets or sets the dark mode skin.
- [SkinLit](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/skinlit.md): Gets or sets the bright mode skin.
- [SnapXAction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/snapxaction.md): Gets or sets the snapping action for the X-direction to draw.
- [SnapYAction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/snapyaction.md): Gets or sets the snapping action for the Y-direction to draw.
- [TextDuration](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/textduration.md)
- [Tiles](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/tiles.md): Gets the tiles currently shown on the canvas.
- [ViewportDragging](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/viewportdragging.md): Gets or sets whether draggable geometry can currently be dragged by directly clicking on it in the viewports. The state is mirrored into the loaded document, and restored from it whenever a different document is loaded.
- [WindowSelectGroups](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/windowselectgroups.md): Gets or sets whether a window selection will include groups.
- [WindowSelectObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/windowselectobjects.md): Gets or sets whether a window selection will include objects.
- [WindowSelectWires](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/windowselectwires.md): Gets or sets whether a window selection will include wires.
- [WireDuration](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/wireduration.md)
- [ZuiVariableParameterState](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/zuivariableparameterstate.md): Gets the current state of the variable parameter ZUI based on recent zooming history.
- [ZuiVariableParameterThreshold](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/zuivariableparameterthreshold.md): Gets or sets the zoom threshold at which variable parameter UI appears.
- [ZuiWireDetailingState](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/zuiwiredetailingstate.md): Gets the current state of the wire detailing based on recent zooming history.
- [ZuiWireDetailingThreshold](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/zuiwiredetailingthreshold.md): Gets or sets the zoom threshold at which wires are drawn in full detail.

## Methods

- [DeleteSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/deleteselection.md): Delete all selected objects in the current document.
- [DispatchRotation](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/dispatchrotation.md): After the generic FlexControl dispatch returns Ignored, route the rotation gesture through a document hit-test so attributes on canvas objects can participate via their [Responses](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.responses.md). The hit-test runs once per gesture session and the result is cached, so the gesture stays on the original object even if its rotation moves it away from the cursor.
- [DrawPickMap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/drawpickmap.md): Draw the picking index map for the current canvas state.
- [DrawToBitmap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/drawtobitmap.md): (3 overloads) Draw this canvas to a bitmap using the default thumbnail size.
- [OnPinchGesture](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/onpinchgesture.md): SHIFT + pinch relays the pinch into the nested navigation target under the cursor, driving its zoom. Any other modifier falls through to the base implementation, which zooms the canvas projection.
- [OnScrollGesture](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/onscrollgesture.md): SHIFT + two-finger scroll relays the scroll into the nested navigation target under the cursor, driving its pan. Any other modifier falls through to the base implementation, which pans the canvas projection.
- [ResolvePick](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/resolvepick.md): Resolve the target of a pick operation on all the objects and wires in the document currently on display in this canvas.
- [ShowInlineEditor](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/showinlineeditor.md): Show a single-line text editor anchored to a rectangle in canvas content (world) coordinates. The editor tracks the canvas projection so it remains anchored to the same content rectangle when the user pans or zooms while editing, with its font scaled to match the current zoom. The `apply` callback is invoked on every change to the text and is responsible for applying the change to the underlying model. If [IResult.Success](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parsing.iresult/success.md) is `true` the editor displays a neutral state. If [IResult.Success](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parsing.iresult/success.md) is `false` the editor tints its background and exposes [IResult.Error](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parsing.iresult/error.md) as a tooltip, but no other action is taken — the most recently applied valid state is retained. The editor closes automatically when it loses focus, and when the user presses Enter or Tab. In all these cases the last successfully applied value is kept. When the user presses Escape the `cancel` callback is invoked first (so the caller can restore the original state) and the editor then closes. The cancel callback is only invoked on Escape. Only one inline editor can be active at a time; calling this method while another editor is open closes the existing one (without invoking its `cancel`) before opening the new one.
- [ShowInstantiationPopup](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/showinstantiationpopup.md): Show the object instantiation window.
- [ShowSearchPopup](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/showsearchpopup.md): Show the search window.

## Events

- [AfterPaintBackground](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/afterpaintbackground.md): Raised after the default background grid has been drawn.
- [AfterPaintGroups](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/afterpaintgroups.md): Raised after the groups have been drawn.
- [AfterPaintObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/afterpaintobjects.md): Raised after the objects have been drawn.
- [AfterPaintWires](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/afterpaintwires.md): Raised after the wires have been drawn.
- [BeforePaintBackground](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/beforepaintbackground.md): Raised before the default background grid is drawn. It is possible to override the default background painting by handling this event.
- [BeforePaintGroups](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/beforepaintgroups.md): Raised before the groups are drawn.
- [BeforePaintObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/beforepaintobjects.md): Raised before the objects are drawn.
- [BeforePaintWires](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/beforepaintwires.md): Raised before the wires are drawn.
- [DocumentChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/documentchanged.md): Raised whenever a different document is loaded in this canvas.
- [DocumentModified](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.canvas/documentmodified.md): Raised whenever the document loaded in this canvas changes its [Document.Modified](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.document/modified.md) property.

## Inherited Members

- From [FlexControl](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol.md): [AllowPan](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/allowpan.md), [AllowScrollGesture](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/allowscrollgesture.md), [AllowZoom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/allowzoom.md), [AutoWindowSelect](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/autowindowselect.md), [Border](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/border.md), [ContentBounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/contentbounds.md), [ContentToControl](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/contenttocontrol.md), [ControlToContent](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/controltocontent.md), [CurrentWindowSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/currentwindowselection.md), [DrawContentBoundary](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/drawcontentboundary.md), [DrawScrollbars](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/drawscrollbars.md), [FloatingButtonRail](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/floatingbuttonrail.md), [FloatingButtons](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/floatingbuttons.md), [FocusObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/focusobject.md), [InnerBounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/innerbounds.md), [InnerScreenBounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/innerscreenbounds.md), [IntegerOrigin](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/integerorigin.md), [IsDragSource](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/isdragsource.md), [IsDropTarget](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/isdroptarget.md), [MaximumZoom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/maximumzoom.md), [MinimumZoom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/minimumzoom.md), [MouseDwellDelay](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/mousedwelldelay.md), [OuterBounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/outerbounds.md), [ParentControl](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/parentcontrol.md), [Projection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/projection.md), [ResizeBehaviour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/resizebehaviour.md), [ResponsivesBackwards](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/responsivesbackwards.md), [ResponsivesForwards](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/responsivesforwards.md), [ScreenBounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/screenbounds.md), [VisibleFrame](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/visibleframe.md), [ZoomFeedbackLocation](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/zoomfeedbacklocation.md), [Draw](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/draw.md), [MouseDwell](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/mousedwell.md), [PopulateContextMenu](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/populatecontextmenu.md), [ProjectionChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/projectionchanged.md), [WindowSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/windowselection.md), [AddSparkle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/addsparkle.md), [Animate<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/animate.md), [AnimatedZoomFactor](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/animatedzoomfactor.md), [BeginWindowSelect](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/beginwindowselect.md), [ComputeWrappingBounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/computewrappingbounds.md), [CreateFloatingButtons](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/createfloatingbuttons.md), [DrawWindowSelectionEdge](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/drawwindowselectionedge.md), [DrawWindowSelectionFill](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/drawwindowselectionfill.md), [EndWindowSelect](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/endwindowselect.md), [FloatingButtonTooltipOverride](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/floatingbuttontooltipoverride.md), [LooksLikeSingleClick](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/lookslikesingleclick.md), [Map](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/map.md), [Navigate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/navigate.md), [OnKeyDown](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onkeydown.md), [OnKeyUp](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onkeyup.md), [OnLoad](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onload.md), [OnLoadComplete](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onloadcomplete.md), [OnMouseDoubleClick](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onmousedoubleclick.md), [OnMouseDown](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onmousedown.md), [OnMouseLeave](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onmouseleave.md), [OnMouseMove](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onmousemove.md), [OnMouseUp](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onmouseup.md), [OnMouseWheel](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onmousewheel.md), [OnPaint](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onpaint.md), [OnPopulateContextMenu](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onpopulatecontextmenu.md), [OnSizeChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/onsizechanged.md), [OnTextInput](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/ontextinput.md), [PopFocus](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/popfocus.md), [PushFocus](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/pushfocus.md), [RegisterIResponsive](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/registeriresponsive.md), [ScheduleRedraw](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/scheduleredraw.md), [UnregisterIResponsive](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/unregisteriresponsive.md), [UpdateMapping](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.flexcontrol/updatemapping.md)
