Share via


OvalShape Class

 

Represents a control displayed as a circle or oval.

Namespace:   Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Inheritance Hierarchy

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      Microsoft.VisualBasic.PowerPacks.Shape
        Microsoft.VisualBasic.PowerPacks.SimpleShape
          Microsoft.VisualBasic.PowerPacks.OvalShape

Syntax

[ToolboxBitmapAttribute(typeof(OvalShape), "Microsoft.VisualBasic.PowerPacks.OvalShape.bmp")]
public class OvalShape : SimpleShape
[ToolboxBitmapAttribute((OvalShape^::typeid), "Microsoft.VisualBasic.PowerPacks.OvalShape.bmp")]
public ref class OvalShape : SimpleShape
[<ToolboxBitmapAttribute(typeof(OvalShape), "Microsoft.VisualBasic.PowerPacks.OvalShape.bmp")>]
type OvalShape = 
    class
        inherit SimpleShape
    end
<ToolboxBitmapAttribute(GetType(OvalShape), "Microsoft.VisualBasic.PowerPacks.OvalShape.bmp")>
Public Class OvalShape
    Inherits SimpleShape

Constructors

Name Description
System_CAPS_pubmethod OvalShape()

Initializes a new instance of the OvalShape class.

System_CAPS_pubmethod OvalShape(Int32, Int32, Int32, Int32)

Initializes a new instance of the OvalShape class, specifying its location and size.

System_CAPS_pubmethod OvalShape(ShapeContainer)

Initializes a new instance of the OvalShape class, specifying the ShapeContainer in which it will be contained.

Properties

Name Description
System_CAPS_pubproperty AccessibilityObject

Gets the AccessibleObject that is assigned to the control.(Inherited from Shape.)

System_CAPS_pubproperty AccessibleDefaultActionDescription

Gets or sets the default action description of the control for use by accessibility client applications.(Inherited from Shape.)

System_CAPS_pubproperty AccessibleDescription

Gets or sets the description of the control that is used by accessibility client applications.(Inherited from Shape.)

System_CAPS_pubproperty AccessibleName

Gets or sets the name of the control that is used by accessibility client applications.(Inherited from Shape.)

System_CAPS_pubproperty AccessibleRole

Gets or sets the accessible role of the control.(Inherited from Shape.)

System_CAPS_pubproperty Anchor

Gets or sets the edges of the container to which a shape is bound, and determines how a shape is resized when its parent is resized.(Inherited from Shape.)

System_CAPS_pubproperty BackColor

Gets or sets the background color for the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty BackgroundImage

Gets or sets the image displayed in the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty BackgroundImageLayout

Gets or sets the background image layout as defined in the ImageLayout enumeration.(Inherited from SimpleShape.)

System_CAPS_pubproperty BackStyle

Gets or sets the transparency of the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty BorderColor

Gets or sets the color of the border of a shape or line control.(Inherited from Shape.)

System_CAPS_pubproperty BorderStyle

Gets or sets the border style for a shape or line control. (Inherited from Shape.)

System_CAPS_pubproperty BorderWidth

Gets or sets the width of the shape control's border.(Inherited from SimpleShape.)

System_CAPS_pubproperty Bottom

Gets the distance, in pixels, between the bottom edge of the shape and the top edge of its container's client area.(Inherited from SimpleShape.)

System_CAPS_pubproperty Bounds

Gets or sets the size and location of the shape in pixels, relative to the parent control.(Inherited from SimpleShape.)

System_CAPS_pubproperty CanFocus

Gets a value indicating whether a line or shape control can receive focus.(Inherited from Shape.)

System_CAPS_protproperty CanRaiseEvents

(Inherited from Component.)

System_CAPS_pubproperty CanSelect

Gets a value indicating whether a line or shape control can be selected.(Inherited from Shape.)

System_CAPS_pubproperty ClientRectangle

Gets the rectangle that represents the client area of the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty ClientSize

Gets or sets the height and width of the client area of the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty Container

Gets the IContainer that contains the Component.(Inherited from Shape.)

System_CAPS_pubproperty ContainsFocus

Gets a value indicating whether a line or shape control currently has the input focus.(Inherited from Shape.)

System_CAPS_pubproperty ContextMenu

Gets or sets the shortcut menu associated with a line or shape control.(Inherited from Shape.)

System_CAPS_pubproperty ContextMenuStrip

Gets or sets the ContextMenuStrip associated with a line or shape control.(Inherited from Shape.)

System_CAPS_pubproperty Created

Gets a value indicating whether a line or shape control has been created.(Inherited from Shape.)

System_CAPS_pubproperty Cursor

Gets or sets the cursor that is displayed when the mouse pointer is resting on a line or shape control.(Inherited from Shape.)

System_CAPS_protproperty DesignMode

(Inherited from Component.)

System_CAPS_pubproperty DisplayRectangle

Gets the rectangle that represents the display area of the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty Disposing

Gets a value indicating whether the base Shape class is disposing.(Inherited from Shape.)

System_CAPS_pubproperty Enabled

Gets or sets a value indicating whether a line or shape control can respond to user interaction.(Inherited from Shape.)

System_CAPS_protproperty Events

(Inherited from Component.)

System_CAPS_pubproperty FillColor

Gets or sets the color that is used to fill the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty FillGradientColor

Gets or sets the gradient color that is used to fill the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty FillGradientStyle

Gets or sets the gradient style that is used to fill the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty FillStyle

Gets or sets the pattern used to fill the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty Focused

Gets a value indicating whether a line or shape control currently has the input focus.(Inherited from Shape.)

System_CAPS_pubproperty Height

Gets or sets the height of the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty IsAccessible

Gets or sets a value indicating whether a line or shape control is available to accessibility applications.(Inherited from Shape.)

System_CAPS_pubproperty IsDisposed

Gets a value indicating whether a line or shape control has been disposed of.(Inherited from Shape.)

System_CAPS_pubproperty Left

Gets or sets the distance, in pixels, between the left edge of the shape and the left edge of its container's client area.(Inherited from SimpleShape.)

System_CAPS_pubproperty Location

Gets or sets the coordinates of the upper-left corner of the shape relative to the upper-left corner of its container.(Inherited from SimpleShape.)

System_CAPS_pubproperty Name

Gets or sets the name of a line or shape control.(Inherited from Shape.)

System_CAPS_pubproperty Parent

Gets or sets the parent container of a line or shape control.(Inherited from Shape.)

System_CAPS_pubproperty Region

Gets or sets the window region associated with a line or shape control.(Inherited from Shape.)

System_CAPS_pubproperty Right

Gets the distance, in pixels, between the right edge of the shape and the left edge of its container's client area.(Inherited from SimpleShape.)

System_CAPS_pubproperty SelectionColor

Gets or sets the selection color of a shape.(Inherited from Shape.)

System_CAPS_pubproperty Site

(Inherited from Component.)

System_CAPS_pubproperty Size

Gets or sets the height and width of the shape.(Inherited from SimpleShape.)

System_CAPS_pubproperty Tag

Gets or sets the object that contains data about a line or shape control.(Inherited from Shape.)

System_CAPS_pubproperty Top

Gets or sets the distance, in pixels, between the top edge of the shape and the left edge of its container's client area.(Inherited from SimpleShape.)

System_CAPS_pubproperty UseWaitCursor

Gets or sets a value indicating whether to use the wait cursor for the current line or shape control.(Inherited from Shape.)

System_CAPS_pubproperty Visible

Gets or sets a value indicating whether a line or shape control is displayed.(Inherited from Shape.)

System_CAPS_pubproperty Width

Gets or sets the width of the shape.(Inherited from SimpleShape.)

Methods

Name Description
System_CAPS_pubmethod BringToFront()

Brings a line or shape control to the front of the z-order.(Inherited from Shape.)

System_CAPS_protmethod CreateAccessibilityInstance()

Creates a new accessibility object for the shape control.(Inherited from SimpleShape.)

System_CAPS_pubmethod CreateObjRef(Type)

(Inherited from MarshalByRefObject.)

System_CAPS_pubmethod Dispose()

(Inherited from Component.)

System_CAPS_protmethod Dispose(Boolean)

Releases the unmanaged resources used by a line or shape control and optionally releases the managed resources.(Inherited from Shape.)

System_CAPS_pubmethod DrawToBitmap(Bitmap, Rectangle)

Supports rendering to the specified bitmap.(Inherited from SimpleShape.)

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Component.)

System_CAPS_pubmethod FindForm()

Retrieves the form that a line or shape control is on.(Inherited from Shape.)

System_CAPS_pubmethod Focus()

Sets input focus to a line or shape control.(Inherited from Shape.)

System_CAPS_pubmethod GetContainerControl()

Returns the next ContainerControl up in a line or shape control's chain of parent controls.(Inherited from Shape.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetLifetimeService()

(Inherited from MarshalByRefObject.)

System_CAPS_protmethod GetService(Type)

(Inherited from Component.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod Hide()

Conceals a line or shape control from the user.(Inherited from Shape.)

System_CAPS_pubmethod HitTest(Int32, Int32)

Determines whether a shape control is located at the specified point on the screen.(Inherited from SimpleShape.)

System_CAPS_pubmethod InitializeLifetimeService()

(Inherited from MarshalByRefObject.)

System_CAPS_pubmethod Invalidate()

Invalidates a specific region of a line or shape control and causes a paint message to be sent to the control.(Inherited from Shape.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone(Boolean)

(Inherited from MarshalByRefObject.)

System_CAPS_protmethod OnBackColorChanged(EventArgs)

Raises the BackColorChanged event.(Inherited from SimpleShape.)

System_CAPS_protmethod OnBackgroundImageChanged(EventArgs)

Raises the BackgroundImageChanged event.(Inherited from SimpleShape.)

System_CAPS_protmethod OnBackgroundImageLayoutChanged(EventArgs)

Raises the BackgroundImageLayoutChanged event.(Inherited from SimpleShape.)

System_CAPS_protmethod OnClick(EventArgs)

Raises the Click event.(Inherited from Shape.)

System_CAPS_protmethod OnClientSizeChanged(EventArgs)

Raises the ClientSizeChanged event.(Inherited from SimpleShape.)

System_CAPS_protmethod OnContextMenuChanged(EventArgs)

Raises the ContextMenuChanged event.(Inherited from Shape.)

System_CAPS_protmethod OnContextMenuStripChanged(EventArgs)

Raises the ContextMenuStripChanged event.(Inherited from Shape.)

System_CAPS_protmethod OnCursorChanged(EventArgs)

Raises the CursorChanged event.(Inherited from Shape.)

System_CAPS_protmethod OnDoubleClick(EventArgs)

Raises the DoubleClick event.(Inherited from Shape.)

System_CAPS_protmethod OnEnabledChanged(EventArgs)

Raises the EnabledChanged event.(Inherited from Shape.)

System_CAPS_protmethod OnEnter(EventArgs)

Raises the Enter event.(Inherited from Shape.)

System_CAPS_protmethod OnGotFocus(EventArgs)

Raises the GotFocus event.(Inherited from Shape.)

System_CAPS_protmethod OnInvalidated(InvalidateEventArgs)

Raises the Invalidated event.(Inherited from Shape.)

System_CAPS_protmethod OnKeyDown(KeyEventArgs)

Raises the KeyDown event.(Inherited from Shape.)

System_CAPS_protmethod OnKeyPress(KeyPressEventArgs)

Raises the KeyPress event.(Inherited from Shape.)

System_CAPS_protmethod OnKeyUp(KeyEventArgs)

Raises the KeyUp event.(Inherited from Shape.)

System_CAPS_protmethod OnLeave(EventArgs)

Raises the Leave event.(Inherited from Shape.)

System_CAPS_protmethod OnLocationChanged(EventArgs)

Raises the LocationChanged event.(Inherited from SimpleShape.)

System_CAPS_protmethod OnLostFocus(EventArgs)

Raises the LostFocus event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseClick(MouseEventArgs)

Raises the MouseClick event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseDoubleClick(MouseEventArgs)

Raises the MouseDoubleClick event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseDown(MouseEventArgs)

Raises the MouseDown event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseEnter(EventArgs)

Raises the MouseEnter event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseHover(EventArgs)

Raises the MouseHover event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseLeave(EventArgs)

Raises the MouseLeave event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseMove(MouseEventArgs)

Raises the MouseMove event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseUp(MouseEventArgs)

Raises the MouseUp event.(Inherited from Shape.)

System_CAPS_protmethod OnMouseWheel(MouseEventArgs)

Raises the MouseWheel event.(Inherited from Shape.)

System_CAPS_protmethod OnMove(EventArgs)

Raises the Move event.(Inherited from Shape.)

System_CAPS_protmethod OnPaint(PaintEventArgs)

Raises the Paint event.(Inherited from SimpleShape.)

System_CAPS_protmethod OnParentChanged(EventArgs)

Raises the ParentChanged event.(Inherited from Shape.)

System_CAPS_protmethod OnPreviewKeyDown(PreviewKeyDownEventArgs)

Raises the PreviewKeyDown event.(Inherited from Shape.)

System_CAPS_protmethod OnQueryAccessibilityHelp(QueryAccessibilityHelpEventArgs)

Raises the QueryAccessibilityHelp event.(Inherited from Shape.)

System_CAPS_protmethod OnRegionChanged(EventArgs)

Raises the RegionChanged event.(Inherited from Shape.)

System_CAPS_protmethod OnResize(EventArgs)

Raises the Resize event.(Inherited from SimpleShape.)

System_CAPS_protmethod OnSizeChanged(EventArgs)

Raises the SizeChanged event.(Inherited from SimpleShape.)

System_CAPS_protmethod OnVisibleChanged(EventArgs)

Raises the VisibleChanged event.(Inherited from Shape.)

System_CAPS_pubmethod PointToClient(Point)

Computes the location of the specified screen point into client coordinates.(Inherited from Shape.)

System_CAPS_pubmethod PointToScreen(Point)

Computes the location of the specified client point into screen coordinates.(Inherited from Shape.)

System_CAPS_pubmethod RectangleToClient(Rectangle)

Computes the size and location of the specified screen rectangle in client coordinates.(Inherited from Shape.)

System_CAPS_pubmethod RectangleToScreen(Rectangle)

Computes the size and location of the specified client rectangle in screen coordinates.(Inherited from Shape.)

System_CAPS_pubmethod Refresh()

Forces a control to invalidate its client area and immediately redraw itself and any child controls.(Inherited from Shape.)

System_CAPS_pubmethod ResumePaint(Boolean)

Resumes usual painting logic, optionally forcing an immediate layout of pending paint requests.(Inherited from Shape.)

System_CAPS_pubmethod Scale(SizeF)

Scales the shape by the specified scaling factor.(Inherited from SimpleShape.)

System_CAPS_pubmethod Select()

Enables a control.(Inherited from Shape.)

System_CAPS_pubmethod SendToBack()

Sends a line or shape control to the back of the z-order.(Inherited from Shape.)

System_CAPS_pubmethod SetBounds(Int32, Int32, Int32, Int32)

Sets the bounds of the shape to the specified location and size.(Inherited from SimpleShape.)

System_CAPS_pubmethod Show()

Displays a shape to the user.(Inherited from Shape.)

System_CAPS_pubmethod SuspendPaint()

Suspends the painting logic for a shape.(Inherited from Shape.)

System_CAPS_pubmethod ToString()

(Inherited from Component.)

System_CAPS_pubmethod Update()

Causes the control to redraw the invalidated regions within its client area.(Inherited from Shape.)

Events

Name Description
System_CAPS_pubevent BackColorChanged

Occurs when the BackColor property of the shape is changed.(Inherited from SimpleShape.)

System_CAPS_pubevent BackgroundImageChanged

Occurs when the BackgroundImage property of a shape is changed.(Inherited from SimpleShape.)

System_CAPS_pubevent BackgroundImageLayoutChanged

Occurs when the BackgroundImageLayout property of a shape is changed.(Inherited from SimpleShape.)

System_CAPS_pubevent ChangeUICues

Occurs when the focus or keyboard user interface (UI) cues change.(Inherited from Shape.)

System_CAPS_pubevent Click

Occurs when the shape is clicked.(Inherited from Shape.)

System_CAPS_pubevent ClientSizeChanged

Occurs when the ClientSize property of a shape is changed.(Inherited from SimpleShape.)

System_CAPS_pubevent ContextMenuChanged

Occurs when the value of the ContextMenu property changes.(Inherited from Shape.)

System_CAPS_pubevent ContextMenuStripChanged

Occurs when the value of the ContextMenuStrip property changes.(Inherited from Shape.)

System_CAPS_pubevent CursorChanged

Occurs when the value of the Cursor property changes.(Inherited from Shape.)

System_CAPS_pubevent Disposed

(Inherited from Component.)

System_CAPS_pubevent DoubleClick

Occurs when the shape is double-clicked.(Inherited from Shape.)

System_CAPS_pubevent EnabledChanged

Occurs when the Enabled property value has changed.(Inherited from Shape.)

System_CAPS_pubevent Enter

Occurs when the shape is entered.(Inherited from Shape.)

System_CAPS_pubevent GotFocus

Occurs when the shape receives focus.(Inherited from Shape.)

System_CAPS_pubevent Invalidated

Occurs when a shape's display requires redrawing.(Inherited from Shape.)

System_CAPS_pubevent KeyDown

Occurs when a key is pressed and the shape has focus.(Inherited from Shape.)

System_CAPS_pubevent KeyPress

Occurs when a key is pressed and the shape has focus.(Inherited from Shape.)

System_CAPS_pubevent KeyUp

Occurs when a key is released and the shape has focus.(Inherited from Shape.)

System_CAPS_pubevent Leave

Occurs when the input focus leaves the shape.(Inherited from Shape.)

System_CAPS_pubevent LocationChanged

Occurs when the Location property of a shape is changed.(Inherited from SimpleShape.)

System_CAPS_pubevent LostFocus

Occurs when the shape loses focus.(Inherited from Shape.)

System_CAPS_pubevent MouseClick

Occurs when the shape is clicked by the mouse.(Inherited from Shape.)

System_CAPS_pubevent MouseDoubleClick

Occurs when the shape is double-clicked by the mouse.(Inherited from Shape.)

System_CAPS_pubevent MouseDown

Occurs when the mouse pointer is over the shape and a mouse button is pressed.(Inherited from Shape.)

System_CAPS_pubevent MouseEnter

Occurs when the mouse pointer enters the shape.(Inherited from Shape.)

System_CAPS_pubevent MouseHover

Occurs when the mouse pointer rests on the shape.(Inherited from Shape.)

System_CAPS_pubevent MouseLeave

Occurs when the mouse pointer leaves the shape. (Inherited from Shape.)

System_CAPS_pubevent MouseMove

Occurs when the mouse pointer is moved over the shape.(Inherited from Shape.)

System_CAPS_pubevent MouseUp

Occurs when the mouse pointer is over the shape and a mouse button is released.(Inherited from Shape.)

System_CAPS_pubevent MouseWheel

Occurs when the mouse wheel moves and the shape has focus.(Inherited from Shape.)

System_CAPS_pubevent Move

Occurs when the shape is moved.(Inherited from Shape.)

System_CAPS_pubevent Paint

Occurs when the shape is redrawn.(Inherited from Shape.)

System_CAPS_pubevent ParentChanged

Occurs when the Parent property value changes.(Inherited from Shape.)

System_CAPS_pubevent PreviewKeyDown

Occurs before the KeyDown event when a key is pressed and focus is on the shape.(Inherited from Shape.)

System_CAPS_pubevent QueryAccessibilityHelp

Occurs when an AccessibleObject is providing Help to accessibility applications. (Inherited from Shape.)

System_CAPS_pubevent RegionChanged

Occurs when the value of the Region property changes.(Inherited from Shape.)

System_CAPS_pubevent Resize

Occurs when the size of a shape is changed.(Inherited from SimpleShape.)

System_CAPS_pubevent SizeChanged

Occurs when the Size property of a shape is changed.(Inherited from SimpleShape.)

System_CAPS_pubevent VisibleChanged

Occurs when the Visible property value changes.(Inherited from Shape.)

Remarks

The OvalShape control enables you to draw circles and ovals on a form or container at design time or run time.

When you add a Line or Shape control to a form or container, an invisible ShapeContainer object is created. The ShapeContainer acts as a drawing surface for the shapes within each container control. Each ShapeContainer has a corresponding ShapeCollection that enables you to iterate through the Line and Shape controls that are contained in the ShapeContainer.

When you create an OvalShape control at run time, you must also create a ShapeContainer and set the Parent property of the OvalShape to the ShapeContainer.

Examples

The following example creates a ShapeContainer and an OvalShape, adds them to a form, and displays a circle.

private void DrawCircle1()
{
    Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
        new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
    Microsoft.VisualBasic.PowerPacks.OvalShape oval1 = 
        new Microsoft.VisualBasic.PowerPacks.OvalShape();
    // Set the form as the parent of the ShapeContainer.
    canvas.Parent = this;
    // Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas;
    // Set the location and size of the circle.
    oval1.Left = 10;
    oval1.Top = 10;
    oval1.Width = 100;
    oval1.Height = 100;
}
Private Sub DrawCircle()
    Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
    Dim oval1 As New Microsoft.VisualBasic.PowerPacks.OvalShape
    ' Set the form as the parent of the ShapeContainer.
    canvas.Parent = Me
    ' Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas
    ' Set the location and size of the circle.
    oval1.Left = 10
    oval1.Top = 10
    oval1.Width = 100
    oval1.Height = 100
End Sub

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Microsoft.VisualBasic.PowerPacks Namespace
Introduction to the Line and Shape Controls (Visual Studio)
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)

Return to top