# TXDrawingControl Class

> The WPF.TXDrawingControl class implements a WPF FrameworkElement with features to draw custom or predefined shapes. It can be added to a document with the WPF.TextControl.Drawings property. The WPF.TXDrawingControl class is inherited from the System.Windows.FrameworkElement class. The following describes only the properties, methods and events defined through the WPF.TXDrawingControl class. For a list of properties, methods and events inherited from the System.Windows.FrameworkElement class see the .NET Framework reference.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.WPF.Drawing`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDrawing.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDrawing.WPF.dll` from the setup
- **Inherits:** `System.Windows.FrameworkElement`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF.Drawing > TXDrawingControl Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/#members)

---

## In This Section

- [TXDrawingControl.AdaptBounds Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/adaptbounds-event/llms.txt): Indicates that the visible bounds of the displayed shapes have been changed (by changing the shape's angle, outline width, yellow adjust rectangles or the control's border width) in so far that the control requires an update of its bounds. The event always raises if the visible bounds exceed the control's bounds. If IsCanvasVisible is false, AdaptBounds is also raised if considering changes lead to a decreasing of the visible shape bounds. The event handler receives an argument of type EventArgs containing data related to this event.
- [TXDrawingControl.BackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/backcolor-property/llms.txt): Gets or sets the TX Drawing Control's back color. The default value is the color System.Windows.Media.Colors.Transparent. If the property is set to null the current System.Windows.SystemColors.WindowColor is used.
- [TXDrawingControl.BorderColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/bordercolor-property/llms.txt): Gets or sets the TX Drawing Control's border line color.The default value is null and represents the color System.Windows.SystemColors.WindowTextColor.
- [TXDrawingControl.BorderWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/borderwidth-property/llms.txt): Gets or sets the TX Drawing Control's border line width. The value is given in twips. The default value is 0.
- [TXDrawingControl.CanCopy Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/cancopy-property/llms.txt): Informs whether shapes are selected which can be copied to the internal clipboard.
- [TXDrawingControl.CanPaste Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/canpaste-property/llms.txt): Informs whether the internal clipboard contains shapes that can be pasted into the TX Drawing Control.
- [TXDrawingControl.CanRedo Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/canredo-property/llms.txt): Informs whether an operation can be re-done using the Redo method.
- [TXDrawingControl.CanUndo Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/canundo-property/llms.txt): Gets a value indicating whether the user can undo the previous operation in the TX Drawing Control.
- [TXDrawingControl.Changed Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/changed-event/llms.txt): Indicates that the number or formatting of the displayed shapes has been changed. The event handler receives an argument of type EventArgs containing data related to this event.
- [TXDrawingControl.ClearUndo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/clearundo-method/llms.txt): Clears the undo buffer of the TX Drawing Control.
- [TXDrawingControl Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/constructor/llms.txt): Initializes a new instance of the TXDrawingControl class.
- [TXDrawingControl.Copy Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/copy-method/llms.txt): Copies the current selected shapes of the TX Drawing Control to the Clipboard.
- [TXDrawingControl.Cut Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/cut-method/llms.txt): Moves the current selected shapes of the TX Drawing Control to the Clipboard.
- [TXDrawingControl.FormatShapesDialog Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/formatshapesdialog-method/llms.txt): Opens a dialog to format selected shapes.
- [TXDrawingControl.IsCanvasVisible Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/iscanvasvisible-property/llms.txt): Gets a value whether the TX Drawing Control is interpreted as canvas or not. The control is not interpreted as canvas if it contains only one shape, the shape's CanFitToCanvas property is set to false, its AutoSize property is set to true and the control's BorderWidth property is 0. If the property's value is false the control can be thought of as a representation of the containing shape where bounds changes of the control lead to considering changes of the shape and vise versa.
- [TXDrawingControl.Load Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/load-method/llms.txt): Loads shapes data into the TX Drawing Control from a specified object of type System.IO.Stream.
- [TXDrawingControl.Paste Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/paste-method/llms.txt): Pastes the content of the clipboard into the TX Drawing Control
- [TXDrawingControl.PrintPaint Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/printpaint-method/llms.txt): Renders the displayed shapes on the specified System.Drawing.Graphics object.
- [TXDrawingControl.Redo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/redo-method/llms.txt): Redoes the last TX Drawing Control operation.
- [TXDrawingControl.Save Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/save-method/llms.txt): Saves the shapes data to the given object of type System.IO.Stream.
- [TXDrawingControl.SaveImage Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/saveimage-method/llms.txt): Saves the displayed shapes as an image.
- [TXDrawingControl.SelectAll Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/selectall-method/llms.txt): Selects all shapes in the TX Drawing Control.
- [TXDrawingControl.Selection Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/selection-property/llms.txt): Gets an object of type Drawing.Selection that represents the current selected shapes inside the TX Drawing Control.
- [TXDrawingControl.SetCanvasSize Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/setcanvassize-method/llms.txt): Specifies, pursuant to a ZoomFactor value of 100, the height and width of the canvas. The parameters must be given in twips.
- [TXDrawingControl.ShapeAdjusted Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapeadjusted-event/llms.txt): Occurs when a shape has been adjusted by using its yellow adjust rectangle. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.ShapeClicked Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapeclicked-event/llms.txt): Occurs when a shape has been clicked on. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.ShapeCreated Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapecreated-event/llms.txt): Occurs when a new shape has been created. It occurs, when a shape has been inserted in TX Drawing Control's shapes collection by pasting or using the shape collection's Add method. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.ShapeDeleted Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapedeleted-event/llms.txt): Occurs when a shape has been deleted from the TX Drawing Control's shapes collection. It occurs by cutting or using the shape collection's Remove, RemoveAt or Clear method. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.ShapeDeselected Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapedeselected-event/llms.txt): Occurs when a shape has been deselected. It occurs by removing a shape from the WPF.TXDrawingControl.Selection.Shapes property or, if the number of selected shapes is greater than 0, clicking on a location inside the TX Drawing Control where no shape is located. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.ShapeFlipped Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapeflipped-event/llms.txt): Occurs when a shape has been flipped. It occurs by using the shape's Flip property or sizing a shape manually by mouse in so far as the shape is flipped horizontally or vertically. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.ShapeFormatChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapeformatchanged-event/llms.txt): Occurs when shape formatting attributes which cannot be handled with the built-in mouse interface have been changed. The corresponding attributes are the shape's ShapeFill, ShapeOutline are Type properties. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.ShapeMoved Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapemoved-event/llms.txt): Occurs when a shape has been moved with the built-in mouse interface. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.Shapes Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapes-property/llms.txt): Gets an object of type ShapeCollection that represents those shapes which are displayed inside the TX Drawing Control.
- [TXDrawingControl.ShapeSelected Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapeselected-event/llms.txt): Occurs when a shape has been selected. It occurs by using the select all method, changing the TXDrawingControl.Selection.Shapes property or selecting shapes manually by the built-in mouse interface . The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.ShapeSized Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapesized-event/llms.txt): Occurs when a shape has been sized with the built-in mouse interface. The event handler receives an argument of type ShapeEventArgs containing data related to this event.
- [TXDrawingControl.SizeToContent Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/sizetocontent-method/llms.txt): If any changes of the the displayed shapes' visible bounds require an adaption of the TX Drawing Control bounds, the size and/or location of the control is expanded respectively decreased by the considering value of the considering shape's side(s). The method returns an array of doubles which represent the effected alteration for each control's side (left, top, right, bottom) in twips.
- [TXDrawingControl.Undo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/undo-method/llms.txt): Undoes the last edit operation in the TX Drawing Control.
- [TXDrawingControl.ViewChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/viewchanged-event/llms.txt): Occurs when UI manipulations such as shape moving or selection changing have caused the view to change. The event handler receives an argument of type ViewChangedEventArgs containing data related to this event.
- [TXDrawingControl.ZoomFactor Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/zoomfactor-property/llms.txt): Gets or sets the zoom factor, in percent, for the TX Drawing Control. When the value is changed both all drawn shapes and the control itself are resized considering to the specified zoom factor. The default value is 100.

---

## Nearby

- **Previous:** [ShapesContextMenu.StandardMenuItems Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/shapescontextmenu/standardmenuitems-property/llms.txt)
- **Next:** [TXDrawingControl.AdaptBounds Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/adaptbounds-event/llms.txt)
