Canvas
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.0.0.0)
Represents the HTML5 canvas element.
- C#
- VB.NET
public class Canvas : Control, IWisejHandler
Public Class Canvas
Inherits Control
Implements IWisejHandler
Constructors
Canvas()
Initializes a new instance of the Canvas class.
Properties
BorderStyle
BorderStyle: Indicates the border style for the control.
FillStyle
Object: Sets or returns the color, gradient, or pattern used to fill the drawing.
GlobalAlpha
Single: Sets or returns the current alpha or transparency value of the drawing.
GlobalCompositeOperation
CanvasCompositeOperation: Sets or returns how a new image are drawn onto an existing image.
LineCap
CanvasLineCap: Sets or returns the style of the end caps for a line.
LineDashOffset
Single: Sets or returns the type of corner created, when two lines meet.
LineJoin
CanvasLineJoin: Sets or returns the type of corner created, when two lines meet.
LineWidth
Int32: Sets or returns the current line width, in pixels.
LiveUpdate
Boolean: Turns live update mode on or off. When live update is on, all canvas calls are pushed to the client immediately, when is off (default) the control updates the client at the end of the request.
MiterLimit
Int32: Sets or returns the maximum miter length.
ShadowBlur
Int32: Sets or returns the blur level for shadows.
ShadowColor
Color: Sets or returns the color to use for shadows.
ShadowOffsetX
Int32: Sets or returns the horizontal distance of the shadow from the shape.
ShadowOffsetY
Int32: Sets or returns the vertical distance of the shadow from the shape.
StrokeStyle
Object: Sets or returns the color, gradient, or pattern used for strokes.
TextAlign
CanvasTextAlign: Sets or returns the current alignment for text content, according to the anchor point.
TextBaseline
CanvasTextBaseline: Sets or returns the current text baseline used when drawing text.
TextFont
Font: Sets or returns the current font properties for text content on the canvas.
Methods
Arc(x, y, radius, startAngle, endAngle, counterClockwise)
Creates an arc/curve (used to create circles, or parts of circles).
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The x-coordinate of the center of the circle. |
| y | Int32 | The y-coordinate of the center of the circle. |
| radius | Int32 | The radius of the circle. |
| startAngle | Single | The starting angle, in degrees. |
| endAngle | Single | The ending angle, in degrees. |
| counterClockwise | Boolean | Specifies whether the drawing should be counterclockwise or clockwise. Default is false. |
Arc(location, radius, startAngle, endAngle, counterClockwise)
Creates an arc/curve (used to create circles, or parts of circles).
| Parameter | Type | Description |
|---|---|---|
| location | Point | The x-coordinate and y-coordinate of the center of the circle. |
| radius | Int32 | The radius of the circle. |
| startAngle | Single | The starting angle, in degrees. |
| endAngle | Single | The ending angle, in degrees. |
| counterClockwise | Boolean | Specifies whether the drawing should be counterclockwise or clockwise. Default is false. |
ArcTo(x1, y1, x2, y2, radius)
Creates an arc/curve between two tangents on the canvas.
| Parameter | Type | Description |
|---|---|---|
| x1 | Int32 | The x-coordinate of the first tangent. |
| y1 | Int32 | The y-coordinate of the first tangent. |
| x2 | Int32 | The x-coordinate of the second tangent. |
| y2 | Int32 | The y-coordinate of the second tangent. |
| radius | Int32 | The radius of the arc |
ArcTo(location1, location2, radius)
Creates an arc/curve between two tangents on the canvas.
| Parameter | Type | Description |
|---|---|---|
| location1 | Point | The x-coordinate and y-coordinate of the first tangent. |
| location2 | Point | The x-coordinate and y-coordinate of the second tangent. |
| radius | Int32 | The radius of the arc |
BeginPath()
begins a path, or resets the current path.
BezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
Adds a point to the current path by using the specified control points that represent a cubic Bézier curve.
| Parameter | Type | Description |
|---|---|---|
| cp1x | Int32 | The x-coordinate of the first Bézier control point. |
| cp1y | Int32 | The y-coordinate of the first Bézier control point. |
| cp2x | Int32 | The x-coordinate of the second Bézier control point. |
| cp2y | Int32 | The y-coordinate of the second Bézier control point. |
| x | Int32 | The x-coordinate of the ending point. |
| y | Int32 | The y-coordinate of the ending point. |
A cubic bezier curve requires three points. The first two points are control points that are used in the cubic Bézier calculation and the last point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.
ClearRect(rect)
Clears the specified pixels within a given rectangle.
| Parameter | Type | Description |
|---|---|---|
| rect | Rectangle | Rectangle's coordinates and size. |
ClearRect(x, y, width, height)
Clears the specified pixels within a given rectangle.
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle. |
| width | Int32 | The width of the rectangle, in pixels. |
| height | Int32 | The height of the rectangle, in pixels. |
Clip()
Clips a region of any shape and size from the original canvas.
Once a region is clipped, all future drawing will be limited to the clipped region (no access to other regions on the canvas). You can however save the current canvas region using the save() method before using the clip() method, and restore it (with the restore() method) any time in the future.
ClosePath()
Creates a path from the current point back to the starting point.
CreateLinearGradient(x0, y0, x1, y1, colorStops)
Creates a linear gradient object. The gradient can be used to fill rectangles, circles, lines, text, etc.
| Parameter | Type | Description |
|---|---|---|
| x0 | Int32 | The x-coordinate of the start point of the gradient. |
| y0 | Int32 | The y-coordinate of the start point of the gradient. |
| x1 | Int32 | The x-coordinate of the end point of the gradient. |
| y1 | Int32 | The y-coordinate of the end point of the gradient. |
| colorStops | Object[] | Array of color stops. Each element must define a stop value between 0.0 and 1.0 and a color value. |
Returns: Object.
CreatePattern(image, repeat)
Repeats the specified element in the specified direction. The repeated element can be used to draw/fill rectangles, circles, lines etc.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Specifies the image of the pattern to use. |
| repeat | CanvasRepeatPattern | Specifies the repeat pattern. |
Returns: Object.
CreatePattern(imageSource, repeat)
Repeats the specified element in the specified direction. The repeated element can be used to draw/fill rectangles, circles, lines etc.
| Parameter | Type | Description |
|---|---|---|
| imageSource | String | Specifies the source of the image of the pattern to use. |
| repeat | CanvasRepeatPattern | Specifies the repeat pattern. |
Returns: Object.
CreateRadialGradient(x0, y0, r0, x1, y1, r1, colorStops)
Creates a linear gradient object. The gradient can be used to fill rectangles, circles, lines, text, etc.
| Parameter | Type | Description |
|---|---|---|
| x0 | Int32 | The x-coordinate of the start point of the gradient. |
| y0 | Int32 | The y-coordinate of the start point of the gradient. |
| r0 | Single | The radius of the starting circle. |
| x1 | Int32 | The x-coordinate of the end point of the gradient. |
| y1 | Int32 | The y-coordinate of the end point of the gradient. |
| r1 | Single | The radius of the ending circle. |
| colorStops | Object[] | Array of color stops. Each element must define a stop value between 0.0 and 1.0 and a color value. |
Returns: Object.
DrawImage(image, x, y)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Specifies the image to draw. |
| x | Int32 | The x-coordinate where to place the image on the canvas. |
| y | Int32 | The y-coordinate where to place the image on the canvas. |
DrawImage(image, location)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Specifies the image to draw. |
| location | Point | The x-coordinate and y-coordinate where to place the image on the canvas. |
DrawImage(image, x, y, width, height)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Specifies the image to draw. |
| x | Int32 | The x-coordinate where to place the image on the canvas. |
| y | Int32 | The y-coordinate where to place the image on the canvas. |
| width | Int32 | The width of the image to use (stretch or reduce the image). |
| height | Int32 | The height of the image to use (stretch or reduce the image). |
DrawImage(image, rect)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Specifies the image to draw. |
| rect | Rectangle | The coordinates and size of the image to place on the canvas. |
DrawImage(image, clipX, clipY, clipWidth, clipHeight, x, y, width, height)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Specifies the image to draw. |
| clipX | Int32 | The x-coordinate where to start clipping. |
| clipY | Int32 | The y-coordinate where to start clipping. |
| clipWidth | Int32 | The width of the clipped image. |
| clipHeight | Int32 | The height of the clipped image. |
| x | Int32 | The x coordinate where to place the image on the canvas. |
| y | Int32 | The y coordinate where to place the image on the canvas. |
| width | Int32 | The width of the image to use (stretch or reduce the image). |
| height | Int32 | The height of the image to use (stretch or reduce the image). |
DrawImage(image, clipRect, imageRect)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Specifies the image to draw. |
| clipRect | Rectangle | The clip rectangle. |
| imageRect | Rectangle | The size and location of the image to place on the canvas. |
DrawImage(imageSource, x, y)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| imageSource | String | Specifies the image to draw. |
| x | Int32 | The x-coordinate where to place the image on the canvas. |
| y | Int32 | The y-coordinate where to place the image on the canvas. |
DrawImage(imageSource, location)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| imageSource | String | Specifies the image to draw. |
| location | Point | The x-coordinate and y-coordinate where to place the image on the canvas. |
DrawImage(imageSource, x, y, width, height)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| imageSource | String | Specifies the image to draw. |
| x | Int32 | The x coordinate where to place the image on the canvas. |
| y | Int32 | The y coordinate where to place the image on the canvas. |
| width | Int32 | The width of the image to use (stretch or reduce the image). |
| height | Int32 | The height of the image to use (stretch or reduce the image). |
DrawImage(imageSource, rect)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| imageSource | String | Specifies the image to draw. |
| rect | Rectangle | The coordinates and size of the image to place on the canvas. |
DrawImage(imageSource, clipX, clipY, clipWidth, clipHeight, x, y, width, height)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| imageSource | String | Specifies the image to draw. |
| clipX | Int32 | The x coordinate where to start clipping. |
| clipY | Int32 | The y coordinate where to start clipping. |
| clipWidth | Int32 | The width of the clipped image. |
| clipHeight | Int32 | The height of the clipped image. |
| x | Int32 | The x coordinate where to place the image on the canvas. |
| y | Int32 | The y coordinate where to place the image on the canvas. |
| width | Int32 | The width of the image to use (stretch or reduce the image). |
| height | Int32 | The height of the image to use (stretch or reduce the image). |
DrawImage(imageSource, clipRect, imageRect)
Draws an image onto the canvas.
| Parameter | Type | Description |
|---|---|---|
| imageSource | String | Specifies the image to draw. |
| clipRect | Rectangle | The clip rectangle. |
| imageRect | Rectangle | The size and location of the image to place on the canvas. |
Fill()
Fills the current drawing (path.)
FillRect(rect)
Draws a "filled" rectangle. The default color of the fill is black.
| Parameter | Type | Description |
|---|---|---|
| rect | Rectangle | Rectangle's coordinates and size. |
FillRect(x, y, width, height)
Draws a "filled" rectangle. The default color of the fill is black.
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle. |
| width | Int32 | The width of the rectangle, in pixels. |
| height | Int32 | The height of the rectangle, in pixels. |
FillText(text, x, y)
Draws filled text on the canvas. The default color of the text is black.
| Parameter | Type | Description |
|---|---|---|
| text | String | Specifies the text that will be written on the canvas. |
| x | Int32 | The x-coordinate where to start painting the text (relative to the canvas). |
| y | Int32 | The y-coordinate where to start painting the text (relative to the canvas) |
FillText(text, location)
Draws filled text on the canvas. The default color of the text is black.
| Parameter | Type | Description |
|---|---|---|
| text | String | Specifies the text that will be written on the canvas. |
| location | Point | The x-coordinate and y-coordinate where to start painting the text (relative to the canvas). |
GetLineDash()
Returns the current line dash pattern.
Returns: Int32[]. A list of numbers that specifies distances to alternately draw a line and a gap (in coordinate space units).
LineTo(x, y)
Adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line).
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The x-coordinate of where to create the line to. |
| y | Int32 | The y-coordinate of where to create the line to. |
LineTo(location)
Adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line).
| Parameter | Type | Description |
|---|---|---|
| location | Point | The x-coordinate and y-coordinate of where to create the line to. |
MoveTo(x, y)
Moves the path to the specified point in the canvas, without creating a line.
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The x-coordinate of where to move the path to. |
| y | Int32 | The y-coordinate of where to move the path to. |
Use the stroke() method to actually draw the path on the canvas.
MoveTo(location)
Moves the path to the specified point in the canvas, without creating a line.
| Parameter | Type | Description |
|---|---|---|
| location | Point | The x-coordinate and y-coordinate of where to move the path to. |
Use the stroke() method to actually draw the path on the canvas.
QuadraticCurveTo(cpx, cpy, x, y)
Adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.
| Parameter | Type | Description |
|---|---|---|
| cpx | Int32 | The x-coordinate of the Bézier control point. |
| cpy | Int32 | The y-coordinate of the Bézier control point. |
| x | Int32 | The x-coordinate of the ending point. |
| y | Int32 | The y-coordinate of the ending point. |
A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.
Rect(rect)
Creates a rectangle.
| Parameter | Type | Description |
|---|---|---|
| rect | Rectangle | Rectangle's coordinates and size. |
Rect(x, y, width, height)
Creates a rectangle.
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle. |
| width | Int32 | The width of the rectangle, in pixels. |
| height | Int32 | The height of the rectangle, in pixels. |
Restore()
Returns previously saved path state and attributes.
Rotate(degrees)
Method rotates the current drawing.
| Parameter | Type | Description |
|---|---|---|
| degrees | Single | The rotation angle, in degrees. |
The rotation will only affect drawings made AFTER the rotation is done.
Save()
Saves the state of the current context.
Scale(scaleWidth, scaleHeight)
Scales the current drawing, bigger or smaller.
| Parameter | Type | Description |
|---|---|---|
| scaleWidth | Single | Scales the width of the current drawing (1=100%, 0.5=50%, 2=200%, etc.) |
| scaleHeight | Single | Scales the height of the current drawing (1=100%, 0.5=50%, 2=200%, etc.) |
Scale(scale)
Scales the current drawing, bigger or smaller.
| Parameter | Type | Description |
|---|---|---|
| scale | SizeF | Scales the width of the current drawing (1=100%, 0.5=50%, 2=200%, etc.) |
SetLineDash(segments)
Sets the line dash pattern.
| Parameter | Type | Description |
|---|---|---|
| segments | Int32[] | A list of numbers that specifies distances to alternately draw a line and a gap (in coordinate space units). If the number of elements in the array is odd, the elements of the array get copied and concatenated. For example, [5, 15, 25] will become [5, 15, 25, 5, 15, 25]. |
SetTransform(scaleWidth, skewHoriz, skewVert, scaleHeight, x, y)
Resets the current transform to the identity matrix, and then runs transform() with the same arguments.
| Parameter | Type | Description |
|---|---|---|
| scaleWidth | Single | Scales the drawing horizontally. |
| skewHoriz | Single | Skew the drawing horizontally. |
| skewVert | Single | Skew the drawing vertically. |
| scaleHeight | Single | Scales the drawing vertically. |
| x | Int32 | Moves the drawing horizontally |
| y | Int32 | Moves the drawing vertically. |
The transformation will only affect drawings made after the transform() method is called. The transform() method behaves relatively to other transformations made by rotate(), scale(), translate(), or transform(). Example: If you already have set your drawing to scale by two, and the transform() method scales your drawings by two, your drawings will now scale by four.
Stroke()
Draws the path you have defined.
StrokeRect(rect)
Draws a rectangle (no fill). The default color of the stroke is black.
| Parameter | Type | Description |
|---|---|---|
| rect | Rectangle | Rectangle's coordinates and size. |
StrokeRect(x, y, width, height)
Draws a rectangle (no fill). The default color of the stroke is black.
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle. |
| width | Int32 | The width of the rectangle, in pixels. |
| height | Int32 | The height of the rectangle, in pixels. |
StrokeText(text, x, y)
Draws text (with no fill) on the canvas. The default color of the text is black.
| Parameter | Type | Description |
|---|---|---|
| text | String | Specifies the text that will be written on the canvas. |
| x | Int32 | The x-coordinate where to start painting the text (relative to the canvas). |
| y | Int32 | The y-coordinate where to start painting the text (relative to the canvas) |
StrokeText(text, location)
Draws text (with no fill) on the canvas. The default color of the text is black.
| Parameter | Type | Description |
|---|---|---|
| text | String | Specifies the text that will be written on the canvas. |
| location | Point | The x-coordinate and y-coordinate where to start painting the text (relative to the canvas). |
Transform(scaleWidth, skewHoriz, skewVert, scaleHeight, x, y)
Replaces the current transformation matrix.
| Parameter | Type | Description |
|---|---|---|
| scaleWidth | Single | Scales the drawing horizontally. |
| skewHoriz | Single | Skew the drawing horizontally. |
| skewVert | Single | Skew the drawing vertically. |
| scaleHeight | Single | Scales the drawing vertically. |
| x | Int32 | Moves the drawing horizontally |
| y | Int32 | Moves the drawing vertically. |
The transformation will only affect drawings made after the transform() method is called. The transform() method behaves relatively to other transformations made by rotate(), scale(), translate(), or transform(). Example: If you already have set your drawing to scale by two, and the transform() method scales your drawings by two, your drawings will now scale by four.
Translate(x, y)
Remaps the (0,0) position on the canvas.
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The value to add to horizontal (x) coordinates. |
| y | Int32 | The value to add to vertical (y) coordinates. |
When you call a method such as fillRect() after translate(), the value is added to the x- and y-coordinate values.
Translate(location)
Remaps the (0,0) position on the canvas.
| Parameter | Type | Description |
|---|---|---|
| location | Point | The value to add to horizontal (x) and vertical (y) coordinates. |
When you call a method such as fillRect() after translate(), the value is added to the x- and y-coordinate values.
Events
Redraw
EventHandler Fired when the canvas requires a full redraw.
Inherited
Properties
| Name | Description | From |
|---|---|---|
| Anchor | Returns or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. | Control |
| Anonymous | Returns or sets whether the control receives pointer events. Anonymous controls let pointer events bubble to their parents. | Control |
| AppearanceKey | Sets the appearance key for the theme engine. | Control |
| BecomingActiveControl | Returns a flag indicating that the control is becoming the active control. | Control |
| BindingContext | Returns or sets the BindingContext for the control. | Control |
| Bottom | Returns the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. | Control |
| Bounds | Returns or sets the size and location of the control including its non-client area, in pixels and relative to the parent control. | Control |
| CanExecute | Determines whether the control can execute a command. | Control |
| CanFocus | Returns whether the control can receive focus. | Control |
| CanSelect | Returns whether the control can be selected. | Control |
| Capture | Returns or sets whether the control has captured the mouse. | Control |
| ClientEvents | Returns a collection of client events and JavaScript listeners. You may attach multiple listeners to same event. | Control |
| ClientRectangle | Returns the client rectangle of the control. | Control |
| ClientSize | Returns or sets the height and width of the client area. | Control |
| ContainsFocus | Indicates whether the control, or one of its child controls, has the input focus. | Control |
| ContextMenu | Returns or sets the shortcut menu associated with the control. | Control |
| Controls | Returns the collection of controls contained within the control. | Control |
| Created | Returns a value indicating whether the control has been created. | Control |
| CssClass | Returns or sets additional CSS class names to add to the widget. | Control |
| CssStyle | Returns or sets the custom CSS styles to add to the widget. | Control |
| Cursor | Returns or sets the cursor that is displayed when the mouse pointer is over the control. | Control |
| DataBindings | Returns the data bindings for the control. | Control |
| DisplayRectangle | Returns the rectangle that represents the virtual display area of the control. | Control |
| Disposing | Returns whether the control is in the process of disposing itself and child controls. | Control |
| Dock | Returns or sets which control borders are docked to its parent control and determines how a control is resized with its parent. | Control |
| EnableNativeContextMenu | Enables or disables the browser's context menu. | Control |
| Focused | Returns a value indicating whether the control has input focus. | Control |
| Handle | Returns the unique server-side id (handle) for this component. | Control |
| HasChildren | Returns whether the control contains any child control. | Control |
| HasDataBindings | Returns whether the control specifies data bindings. | Control |
| HasResponsiveProfiles | Check if the control defines any responsive profile without forcing the creation of the collection. | Control |
| HasUserData | Checks if the UserData dynamic object was created and has any value. | Control |
| Height | Returns or sets the height of the control. | Control |
| InitScript | Returns or sets an initialization script to execute when the widget is created (or reloaded) in the browser. | Control |
| IsDisposed | Returns whether the control has been disposed. | Control |
| IsHandleCreated | Returns if the control has a server-side component id (handle) associated with it. | Control |
| IsMirrored | Returns whether the control is mirrored. | Control |
| LayoutEngine | Returns the control's layout engine. | Control |
| Left | Returns or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. | Control |
| Location | Returns or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. | Control |
| Margin | Returns or sets the space between controls. | Control |
| MaximumSize | Returns or sets the maximum size for the control. | Control |
| MinimumSize | Returns or sets the minimum size for the control. | Control |
| Movable | Returns or sets whether the control can be moved by dragging. | Control |
| Name | Gets or sets the name of the control. | Control |
| Padding | Returns or sets padding within the control. | Control |
| Parent | Returns or sets the parent container of the control. | Control |
| PreferredSize | Returns the preferred size in which the control can fit. | Control |
| ResizableEdges | Returns or sets the edges of the control that can be dragged to resize the control. | Control |
| ResponsiveProfiles | Returns the collection of responsive properties that have been set for this control. | Control |
| Right | Return the distance, in pixels, between the right edge of the control and the left edge of its container's client area. | Control |
| Selectable | Returns or sets whether the text in the control can be selected in the browser by the user by dragging the pointer. Since 2.5.22 | Control |
| ShowLoader | Returns or sets whether the control is blocked by the ajax loader. | Control |
| Size | Returns or sets the height and width of the control. | Control |
| States | Returns or sets additional theme states to the client widget. | Control |
| Tag | Returns or sets the object that contains data about the control. | Control |
| ToolTipText | Returns or sets the tooltip text to show for this control. | Control |
| Top | Returns or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. | Control |
| TopLevelControl | Returns the parent control that is not parented by another Form. Typically, this is the outermost Form that the control is contained in. | Control |
| UserData | Returns a dynamic object that can be used to store custom data in relation to this control. | Control |
| UseWaitCursor | Returns or sets whether to use the wait cursor for the current control and all child controls. | Control |
| ValidationCancelled | Returns a flag indicating that the validation has been canceled. | Control |
| Visible | Returns or sets whether the control and all its child controls are displayed. | Control |
| Width | Returns or sets the width of the control. | Control |
Methods
| Name | Description | From |
|---|---|---|
| AddClientEventListener(name, script) | Adds a new listener script to the event name to the client widget. | Control |
| AddCssClass(name) | Adds the CSS class name to the widget element. If the class already exists in the CssClass it's not added. | Control |
| AddState(state) | Adds the specified theme state to the widget. | Control |
| BeginInvoke(method) | Executes the specified delegate asynchronously. | Control |
| BeginInvoke(method, args) | Executes the specified delegate asynchronously. | Control |
| BringToFront() | Brings the control to the front of the z-order. | Control |
| Call(function, args) | Runs the JavaScript function within the component's context in the browser. | Control |
| Call(function, callback, args) | Runs the JavaScript function within the component's context in the browser and returns the value to the callback method. | Control |
| CallAsync(function, args) | Asynchronously runs the JavaScript function within the component's context in the browser and returns an awaitable Task containing the value returned by the remote call. | Control |
| CenterToParent() | Centers the position of the control within the bounds of the parent. | Control |
| CenterToParent(horizontal, vertical) | Centers the position of the control within the bounds of the parent either horizontally, vertically or both. | Control |
| Contains(control) | Indicates whether the specified control is a child of this control. | Control |
| CreateControl() | Creates and register this control and all its children. | Control |
| DoDragDrop(data, allowedEffects) | Begins a drag-and-drop operation. | Control |
| DoDragDrop(data, allowedEffects, imageSource) | Begins a drag-and-drop operation. | Control |
| DoDragDrop(data, allowedEffects, imageSource, imageSize) | Begins a drag-and-drop operation. | Control |
| DoDragDrop(data, allowedEffects, image) | Begins a drag-and-drop operation. | Control |
| DoDragDrop(data, allowedEffects, image, imageSize) | Begins a drag-and-drop operation. | Control |
| EndInvoke(asyncResult) | Retrieves the return value from the asynchronous operation represented by asyncResult . | Control |
| Eval(javaScript) | Runs the javaScript code within the component's context in the browser. | Control |
| Eval(javaScript, callback) | Runs the javaScript code within the component's context in the browser and returns the value to the callback method. | Control |
| EvalAsync(javaScript) | Asynchronously runs the javaScript code within the component's context in the browser and returns an awaitable Task that contains the value returned by the remote call. | Control |
| FindForm() | Retrieves the form that the control is on. | Control |
| FindPage() | Retrieves the page that the control is on. | Control |
| Focus() | Sets input focus to the control. | Control |
| GetChildAtPoint(pt, skipValue) | Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type. | Control |
| GetChildAtPoint(pt) | Retrieves the child control that is located at the specified coordinates. | Control |
| GetClientEventListener(id) | Returns the script associated to the listener identified by id . | Control |
| GetClientEventListener(name) | Returns the scripts for all the listeners attached to the event name . | Control |
| GetContainerControl() | Returns the next IContainerControl up the control's chain of parents. | Control |
| GetNextControl(control, forward) | Retrieves the next control forward or back in the tab order of child controls. | Control |
| GetStyle(flag) | Retrieves the value of the specified control style bit for the control. | Control |
| HasClientEventListener(name) | Checks whether the specified event name has any listener attached. | Control |
| HasCssClass(name) | Returns true if the property CssClass contains the specified class name . | Control |
| HasState(state) | Checks whether the specified theme state is present in the States property. | Control |
| Hide() | Conceals the control from the user. | Control |
| Invalidate() | Causes the control to update the client side widget. When in design mode, causes the rendered control to update its entire surface in the designer. | Control |
| Invalidate(invalidateChildren) | Causes the control to update the client side widget. When in design mode, causes the rendered control to update its entire surface in the designer. | Control |
| Invoke(method) | Executes the specified delegate. | Control |
| Invoke(method, args) | Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments. | Control |
| LayoutChildren(dock, spacing, useMargins, hAlign, vAlign) | Arranges all the child Control using the specified dock style, spaced by spacing pixels. | Control |
| LayoutChildren(dock, viewArea, spacing, useMargins, hAlign, vAlign) | Arranges all the child Control using the specified dock style, spaced by spacing pixels. | Control |
| LayoutChildren(controls, dock, spacing, useMargins, hAlign, vAlign) | Arranges all the child Control using the specified dock style, spaced by spacing pixels. | Control |
| LayoutChildren(controls, dock, viewArea, spacing, useMargins, hAlign, vAlign) | Arranges all the child Control using the specified dock style, spaced by spacing pixels. | Control |
| LayoutChildren(direction, spacing, useMargins, hAlign, vAlign) | Arranges all the child Control in the specified direction , spaced by spacing pixels. | Control |
| LayoutChildren(direction, viewArea, spacing, useMargins, hAlign, vAlign) | Arranges all the child Control in the specified direction , spaced by spacing pixels, and constrained within the specified viewArea . | Control |
| LayoutChildren(controls, direction, spacing, useMargins, hAlign, vAlign) | Arranges the specified child controls in the specified direction , spaced by spacing pixels. | Control |
| LayoutChildren(controls, direction, viewArea, spacing, useMargins, hAlign, vAlign) | Arranges the specified child controls in the specified direction , spaced by spacing pixels, and constrained within the specified viewArea . | Control |
| PerformLayout() | Forces the control to apply layout logic to all its child controls. | Control |
| PerformLayout(affectedControl, affectedProperty) | Forces the control to apply layout logic to all its child controls. | Control |
| PointToClient(point) | Computes the location of the specified screen point into client coordinates. | Control |
| PointToScreen(point) | Computes the location of the specified client point into screen coordinates. | Control |
| RectangleToClient(rect) | Computes the size and location of the specified screen rectangle in client coordinates. | Control |
| RectangleToScreen(rect) | Computes the size and location of the specified client rectangle in screen coordinates. | Control |
| Refresh() | Forces the control to update corresponding client widget. When in DesignMode it forces a full redraw of the designer surface for this control, including the non-client areas such as the caption of forms or panels. | Control |
| Refresh(refreshChildren) | Forces the control to update corresponding client widget. When in DesignMode it forces a full redraw of the designer surface for this control and optionally of its children, including the non-client areas such as the caption of forms or panels. | Control |
| RemoveClientEventListener(id) | Detaches and removes the listener identified by id . | Control |
| RemoveClientEventListener(name) | Removes all the listeners attached to the event name . | Control |
| RemoveCssClass(name) | Removes the specified css class name from the control's CssClass property. | Control |
| RemoveState(state) | Removes the specified theme state from the widget. | Control |
| ResetBindings() | Removes all the data bindings from the control. | Control |
| ResumeLayout() | Resumes layout logic. | Control |
| ResumeLayout(performLayout) | Resumes layout logic, optionally forcing an immediate layout of all pending layout requests. | Control |
| ScrollControlIntoView(alignX, alignY) | Scrolls the control into view in the container using the specified alignX and alignY preferences. | Control |
| ScrollControlIntoView() | Scrolls the child control into view. | Control |
| Select() | Activates a control. | Control |
| SelectNextControl(control, forward, tabStopOnly, nested, wrap) | Activates the next control in the list according to the specified selection rules. | Control |
| SendToBack() | Sends the control to the back of the z-order. | Control |
| SetBounds(x, y, width, height) | Sets the bounds of the control to the specified location and size. | Control |
| SetBounds(x, y, width, height, specified) | Sets the specified bounds of the control to the specified location and size. | Control |
| Show() | Displays the control to the user. | Control |
| SuspendLayout() | Suspends the layout logic for the control. | Control |
| Update() | Causes the control to update the corresponding client side widget. When in design mode, causes the rendered control to update its entire surface in the designer. | Control |
| ValidateChildren(flags) | Validates all the child controls in the container. Exactly which controls are validated and which controls are skipped is determined by flags . | Control |
| ValidateChildren() | Validates all selectable child controls in the container, including descendants. This is equivalent to calling ValidateChildren(ValidationConstraints.Selectable). See Selectable for details of exactly which child controls will be validated. | Control |
Events
| Name | Description | From |
|---|---|---|
| Appear | Fired after the control has been fully rendered on the client. | Control |
| BecomingActiveControlChanged | Fired when the value of the BecomingActiveControl property changes. | Control |
| BindingContextChanged | Occurs when the value of the BindingContext property changes. | Control |
| Click | Fired when the control is clicked. | Control |
| ClientSizeChanged | Fired when the ClientSize property value changes. | Control |
| ContextMenuChanged | Fired when the value of the ContextMenu property changes. | Control |
| ControlAdded | Fired when a new control is added to the ControlCollection. | Control |
| ControlCreated | Fired when a control is made visible the first time, fully created and sent to the client. | Control |
| ControlRemoved | Fired when a control is removed from the ControlCollection. | Control |
| CursorChanged | Fired when the value of the Cursor property changes. | Control |
| Disappear | Fired after the control is no longer visible on the client. | Control |
| Disposed | Fired when the component is disposed. | Control |
| DockChanged | Fired when the value of the Dock property changes. | Control |
| DoubleClick | Fired when the control is double-clicked. | Control |
| DragDrop | Fired when a drag-and-drop operation is completed. | Control |
| DragEnd | Fired when a drag-drop operation is terminated either by a drop or canceled. | Control |
| DragEnter | Fired when an object is dragged into the control's bounds. | Control |
| DragLeave | Fired when an object is dragged out of the control's bounds. | Control |
| DragOver | Fired when an object is dragged over the control's bounds. | Control |
| DragStart | Fired when a drag-drop operation is started by the user. | Control |
| EnabledChanged | Fired when the Enabled property value has changed. | Control |
| EndMove | Fired when a control is Movable and the user ends the move operation. | Control |
| EndResize | Fired when a control has ResizableEdges and the user ends the resize operation. | Control |
| GotFocus | Fired when the control gains the focus. | Control |
| HelpRequested | Fired when the user requests help for a control by pressing F1. | Control |
| Layout | Fired when a control should reposition its child controls. | Control |
| LocationChanged | Fired when the Location property value has changed. | Control |
| LongTap | Fired when a pointer holds on the screen. | Control |
| LostFocus | Fired when the control loses focus. | Control |
| MarginChanged | Fired when the control's margin changes. | Control |
| MouseCaptureChanged | Fired when the control loses mouse capture. | Control |
| MouseClick | Fired when the control is clicked by the mouse. | Control |
| MouseDoubleClick | Fired when the control is double clicked by the mouse. | Control |
| MouseDown | Fired when the mouse pointer is over the control and a mouse button is pressed. | Control |
| MouseEnter | Fired when the mouse pointer enters the control. | Control |
| MouseHover | Fired when the mouse pointer rests on the control. | Control |
| MouseLeave | Fired when the mouse pointer leaves the control. | Control |
| MouseMove | Fired when the mouse pointer is moved over the control. | Control |
| MouseUp | Fired when the mouse pointer is over the control and a mouse button is released. | Control |
| MouseWheel | Fired when the mouse wheel moves while the control has focus. | Control |
| PaddingChanged | Fired when the control's padding changes. | Control |
| Paint | Fired when a UserPaint control needs to redraw itself. | Control |
| ParentChanged | Fired when the Parent property value changes. | Control |
| Pinch | Fired when two finger moved towards or away from each other. It contains the scaling factor of the pinch. | Control |
| PreviewKeyDown | Fired before the KeyDown event when a key is pressed while focus is on this control. | Control |
| QueryContinueDrag | Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled. | Control |
| Resize | Fired when the control is resized. | Control |
| ResponsiveProfileChanged | Fired when the active responsive profile is changed. | Control |
| Rotate | Fired when two finger moved around a single point. It contains the angle of the rotation. | Control |
| SizeChanged | Fired when the Size property value changes. | Control |
| StartMove | Fired when a control is Movable and the user begins the move operation. | Control |
| StartResize | Fired when a control has ResizableEdges and the user begins the resize operation. | Control |
| StyleChanged | Fired when the control style changed. | Control |
| Swipe | Fired when a pointer swipes over the screen. | Control |
| Tap | Fired when a pointer taps on the screen. | Control |
| TouchCancel | Fired when a touch point has been disrupted in an implementation-specific manner (for example, too many touch points are created). | Control |
| TouchEnd | Fired when a touch point is removed from the touch surface. | Control |
| TouchMove | Fired when a touch point is moved along the touch surface. | Control |
| TouchStart | Fired when a touch point is placed on the touch surface. | Control |
| Track | Fired when a pointer grabs an item and moves the pointer on it. | Control |
| VisibleChanged | Fired when the Visible property value changes. | Control |
| WidgetEvent | Fired when the control receives a custom event from the client. | Control |
Extension Methods
| Name | Description | From |
|---|---|---|
| Beep(Target, AudioBase64) | Sounds a tone through the computer's speaker. | Interaction |
| InputBox(Target, Prompt, Title, DefaultResponse, XPos, YPos, CloseCallback) | Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. | Interaction |
| InputBoxAsync(Target, Prompt, Title, DefaultResponse, XPos, YPos) | Asynchronous displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. | Interaction |
| MsgBox(Target, Prompt, Buttons, Title, CloseCallback) | Displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked. | Interaction |
| MsgBoxAsync(Target, Prompt, Buttons, Title) | Asynchronously displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked. | Interaction |
| ToJSON(obj, formatted) | Serializes the object to a JSON string. | JSON |
| ToJSON(obj, options) | Serializes the object to a JSON string. | JSON |
Implements
| Name | Description |
|---|---|
| IBindableComponent | Bindable components implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejHandler | Represents a Wisej component that is capable of handling postback requests from the client. |
| IWisejSerializable | Allows an object to serialize itself. |