Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

OvalShape Class

Represents a control displayed as a circle or oval.

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

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
[ToolboxBitmapAttribute(typeof(OvalShape), "Microsoft.VisualBasic.PowerPacks.OvalShape.bmp")]
public class OvalShape : SimpleShape

The OvalShape type exposes the following members.

  NameDescription
Public methodOvalShape()Initializes a new instance of the OvalShape class.
Public methodOvalShape(ShapeContainer)Initializes a new instance of the OvalShape class, specifying the ShapeContainer in which it will be contained.
Public methodOvalShape(Int32, Int32, Int32, Int32)Initializes a new instance of the OvalShape class, specifying its location and size.
Top
  NameDescription
Public propertyAccessibilityObjectGets the AccessibleObject that is assigned to the control. (Inherited from Shape.)
Public propertyAccessibleDefaultActionDescriptionGets or sets the default action description of the control for use by accessibility client applications. (Inherited from Shape.)
Public propertyAccessibleDescriptionGets or sets the description of the control that is used by accessibility client applications. (Inherited from Shape.)
Public propertyAccessibleNameGets or sets the name of the control that is used by accessibility client applications. (Inherited from Shape.)
Public propertyAccessibleRoleGets or sets the accessible role of the control. (Inherited from Shape.)
Public propertyAnchorGets 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.)
Public propertyBackColorGets or sets the background color for the shape. (Inherited from SimpleShape.)
Public propertyBackgroundImageGets or sets the image displayed in the shape. (Inherited from SimpleShape.)
Public propertyBackgroundImageLayoutGets or sets the background image layout as defined in the ImageLayout enumeration. (Inherited from SimpleShape.)
Public propertyBackStyleGets or sets the transparency of the shape. (Inherited from SimpleShape.)
Public propertyBorderColorGets or sets the color of the border of a shape or line control. (Inherited from Shape.)
Public propertyBorderStyleGets or sets the border style for a shape or line control. (Inherited from Shape.)
Public propertyBorderWidthGets or sets the width of the shape control's border. (Inherited from SimpleShape.)
Public propertyBottomGets the distance, in pixels, between the bottom edge of the shape and the top edge of its container's client area. (Inherited from SimpleShape.)
Public propertyBoundsGets or sets the size and location of the shape in pixels, relative to the parent control. (Inherited from SimpleShape.)
Public propertyCanFocusGets a value indicating whether a line or shape control can receive focus. (Inherited from Shape.)
Protected propertyCanRaiseEventsGets a value indicating whether the component can raise an event. (Inherited from Component.)
Public propertyCanSelectGets a value indicating whether a line or shape control can be selected. (Inherited from Shape.)
Public propertyClientRectangleGets the rectangle that represents the client area of the shape. (Inherited from SimpleShape.)
Public propertyClientSizeGets or sets the height and width of the client area of the shape. (Inherited from SimpleShape.)
Public propertyContainerGets the IContainer that contains the Component. (Inherited from Shape.)
Public propertyContainsFocusGets a value indicating whether a line or shape control currently has the input focus. (Inherited from Shape.)
Public propertyContextMenuGets or sets the shortcut menu associated with a line or shape control. (Inherited from Shape.)
Public propertyContextMenuStripGets or sets the ContextMenuStrip associated with a line or shape control. (Inherited from Shape.)
Public propertyCreatedGets a value indicating whether a line or shape control has been created. (Inherited from Shape.)
Public propertyCursorGets or sets the cursor that is displayed when the mouse pointer is resting on a line or shape control. (Inherited from Shape.)
Protected propertyDesignModeGets a value that indicates whether the Component is currently in design mode. (Inherited from Component.)
Public propertyDisplayRectangleGets the rectangle that represents the display area of the shape. (Inherited from SimpleShape.)
Public propertyDisposingGets a value indicating whether the base Shape class is disposing. (Inherited from Shape.)
Public propertyEnabledGets or sets a value indicating whether a line or shape control can respond to user interaction. (Inherited from Shape.)
Protected propertyEventsGets the list of event handlers that are attached to this Component. (Inherited from Component.)
Public propertyFillColorGets or sets the color that is used to fill the shape. (Inherited from SimpleShape.)
Public propertyFillGradientColorGets or sets the gradient color that is used to fill the shape. (Inherited from SimpleShape.)
Public propertyFillGradientStyleGets or sets the gradient style that is used to fill the shape. (Inherited from SimpleShape.)
Public propertyFillStyleGets or sets the pattern used to fill the shape. (Inherited from SimpleShape.)
Public propertyFocusedGets a value indicating whether a line or shape control currently has the input focus. (Inherited from Shape.)
Public propertyHeightGets or sets the height of the shape. (Inherited from SimpleShape.)
Public propertyIsAccessibleGets or sets a value indicating whether a line or shape control is available to accessibility applications. (Inherited from Shape.)
Public propertyIsDisposedGets a value indicating whether a line or shape control has been disposed of. (Inherited from Shape.)
Public propertyLeftGets 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.)
Public propertyLocationGets or sets the coordinates of the upper-left corner of the shape relative to the upper-left corner of its container. (Inherited from SimpleShape.)
Public propertyNameGets or sets the name of a line or shape control. (Inherited from Shape.)
Public propertyParentGets or sets the parent container of a line or shape control. (Inherited from Shape.)
Public propertyRegionGets or sets the window region associated with a line or shape control. (Inherited from Shape.)
Public propertyRightGets the distance, in pixels, between the right edge of the shape and the left edge of its container's client area. (Inherited from SimpleShape.)
Public propertySelectionColorGets or sets the selection color of a shape. (Inherited from Shape.)
Public propertySiteGets or sets the ISite of the Component. (Inherited from Component.)
Public propertySizeGets or sets the height and width of the shape. (Inherited from SimpleShape.)
Public propertyTagGets or sets the object that contains data about a line or shape control. (Inherited from Shape.)
Public propertyTopGets 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.)
Public propertyUseWaitCursorGets or sets a value indicating whether to use the wait cursor for the current line or shape control. (Inherited from Shape.)
Public propertyVisibleGets or sets a value indicating whether a line or shape control is displayed. (Inherited from Shape.)
Public propertyWidthGets or sets the width of the shape. (Inherited from SimpleShape.)
Top
  NameDescription
Public methodBringToFrontBrings a line or shape control to the front of the z-order. (Inherited from Shape.)
Protected methodCreateAccessibilityInstanceCreates a new accessibility object for the shape control. (Inherited from SimpleShape.)
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodDisposeReleases all resources used by the Component. (Inherited from Component.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by a line or shape control and optionally releases the managed resources. (Inherited from Shape.)
Public methodDrawToBitmapSupports rendering to the specified bitmap. (Inherited from SimpleShape.)
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeReleases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)
Public methodFindFormRetrieves the form that a line or shape control is on. (Inherited from Shape.)
Public methodFocusSets input focus to a line or shape control. (Inherited from Shape.)
Public methodGetContainerControlReturns the next ContainerControl up in a line or shape control's chain of parent controls. (Inherited from Shape.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected methodGetServiceReturns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodHideConceals a line or shape control from the user. (Inherited from Shape.)
Public methodHitTestDetermines whether a shape control is located at the specified point on the screen. (Inherited from SimpleShape.)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodInvalidateInvalidates a specific region of a line or shape control and causes a paint message to be sent to the control. (Inherited from Shape.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMemberwiseClone(Boolean)Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Protected methodOnBackColorChangedRaises the BackColorChanged event. (Inherited from SimpleShape.)
Protected methodOnBackgroundImageChangedRaises the BackgroundImageChanged event. (Inherited from SimpleShape.)
Protected methodOnBackgroundImageLayoutChangedRaises the BackgroundImageLayoutChanged event. (Inherited from SimpleShape.)
Protected methodOnClickRaises the Click event. (Inherited from Shape.)
Protected methodOnClientSizeChangedRaises the ClientSizeChanged event. (Inherited from SimpleShape.)
Protected methodOnContextMenuChangedRaises the ContextMenuChanged event. (Inherited from Shape.)
Protected methodOnContextMenuStripChangedRaises the ContextMenuStripChanged event. (Inherited from Shape.)
Protected methodOnCursorChangedRaises the CursorChanged event. (Inherited from Shape.)
Protected methodOnDoubleClickRaises the DoubleClick event. (Inherited from Shape.)
Protected methodOnEnabledChangedRaises the EnabledChanged event. (Inherited from Shape.)
Protected methodOnEnterRaises the Enter event. (Inherited from Shape.)
Protected methodOnGotFocusRaises the GotFocus event. (Inherited from Shape.)
Protected methodOnInvalidatedRaises the Invalidated event. (Inherited from Shape.)
Protected methodOnKeyDownRaises the KeyDown event. (Inherited from Shape.)
Protected methodOnKeyPressRaises the KeyPress event. (Inherited from Shape.)
Protected methodOnKeyUpRaises the KeyUp event. (Inherited from Shape.)
Protected methodOnLeaveRaises the Leave event. (Inherited from Shape.)
Protected methodOnLocationChangedRaises the LocationChanged event. (Inherited from SimpleShape.)
Protected methodOnLostFocusRaises the LostFocus event. (Inherited from Shape.)
Protected methodOnMouseClickRaises the MouseClick event. (Inherited from Shape.)
Protected methodOnMouseDoubleClickRaises the MouseDoubleClick event. (Inherited from Shape.)
Protected methodOnMouseDownRaises the MouseDown event. (Inherited from Shape.)
Protected methodOnMouseEnterRaises the MouseEnter event. (Inherited from Shape.)
Protected methodOnMouseHoverRaises the MouseHover event. (Inherited from Shape.)
Protected methodOnMouseLeaveRaises the MouseLeave event. (Inherited from Shape.)
Protected methodOnMouseMoveRaises the MouseMove event. (Inherited from Shape.)
Protected methodOnMouseUpRaises the MouseUp event. (Inherited from Shape.)
Protected methodOnMouseWheelRaises the MouseWheel event. (Inherited from Shape.)
Protected methodOnMoveRaises the Move event. (Inherited from Shape.)
Protected methodOnPaintRaises the Paint event. (Inherited from SimpleShape.)
Protected methodOnParentChangedRaises the ParentChanged event. (Inherited from Shape.)
Protected methodOnPreviewKeyDownRaises the PreviewKeyDown event. (Inherited from Shape.)
Protected methodOnQueryAccessibilityHelpRaises the QueryAccessibilityHelp event. (Inherited from Shape.)
Protected methodOnRegionChangedRaises the RegionChanged event. (Inherited from Shape.)
Protected methodOnResizeRaises the Resize event. (Inherited from SimpleShape.)
Protected methodOnSizeChangedRaises the SizeChanged event. (Inherited from SimpleShape.)
Protected methodOnVisibleChangedRaises the VisibleChanged event. (Inherited from Shape.)
Public methodPointToClientComputes the location of the specified screen point into client coordinates. (Inherited from Shape.)
Public methodPointToScreenComputes the location of the specified client point into screen coordinates. (Inherited from Shape.)
Public methodRectangleToClientComputes the size and location of the specified screen rectangle in client coordinates. (Inherited from Shape.)
Public methodRectangleToScreenComputes the size and location of the specified client rectangle in screen coordinates. (Inherited from Shape.)
Public methodRefreshForces a control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Shape.)
Public methodResumePaintResumes usual painting logic, optionally forcing an immediate layout of pending paint requests. (Inherited from Shape.)
Public methodScaleScales the shape by the specified scaling factor. (Inherited from SimpleShape.)
Public methodSelectEnables a control. (Inherited from Shape.)
Public methodSendToBackSends a line or shape control to the back of the z-order. (Inherited from Shape.)
Public methodSetBoundsSets the bounds of the shape to the specified location and size. (Inherited from SimpleShape.)
Public methodShowDisplays a shape to the user. (Inherited from Shape.)
Public methodSuspendPaintSuspends the painting logic for a shape. (Inherited from Shape.)
Public methodToStringReturns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.)
Public methodUpdateCauses the control to redraw the invalidated regions within its client area. (Inherited from Shape.)
Top
  NameDescription
Public eventBackColorChangedOccurs when the BackColor property of the shape is changed. (Inherited from SimpleShape.)
Public eventBackgroundImageChangedOccurs when the BackgroundImage property of a shape is changed. (Inherited from SimpleShape.)
Public eventBackgroundImageLayoutChangedOccurs when the BackgroundImageLayout property of a shape is changed. (Inherited from SimpleShape.)
Public eventChangeUICuesOccurs when the focus or keyboard user interface (UI) cues change. (Inherited from Shape.)
Public eventClickOccurs when the shape is clicked. (Inherited from Shape.)
Public eventClientSizeChangedOccurs when the ClientSize property of a shape is changed. (Inherited from SimpleShape.)
Public eventContextMenuChangedOccurs when the value of the ContextMenu property changes. (Inherited from Shape.)
Public eventContextMenuStripChangedOccurs when the value of the ContextMenuStrip property changes. (Inherited from Shape.)
Public eventCursorChangedOccurs when the value of the Cursor property changes. (Inherited from Shape.)
Public eventDisposedOccurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)
Public eventDoubleClickOccurs when the shape is double-clicked. (Inherited from Shape.)
Public eventEnabledChangedOccurs when the Enabled property value has changed. (Inherited from Shape.)
Public eventEnterOccurs when the shape is entered. (Inherited from Shape.)
Public eventGotFocusOccurs when the shape receives focus. (Inherited from Shape.)
Public eventInvalidatedOccurs when a shape's display requires redrawing. (Inherited from Shape.)
Public eventKeyDownOccurs when a key is pressed and the shape has focus. (Inherited from Shape.)
Public eventKeyPressOccurs when a key is pressed and the shape has focus. (Inherited from Shape.)
Public eventKeyUpOccurs when a key is released and the shape has focus. (Inherited from Shape.)
Public eventLeaveOccurs when the input focus leaves the shape. (Inherited from Shape.)
Public eventLocationChangedOccurs when the Location property of a shape is changed. (Inherited from SimpleShape.)
Public eventLostFocusOccurs when the shape loses focus. (Inherited from Shape.)
Public eventMouseClickOccurs when the shape is clicked by the mouse. (Inherited from Shape.)
Public eventMouseDoubleClickOccurs when the shape is double-clicked by the mouse. (Inherited from Shape.)
Public eventMouseDownOccurs when the mouse pointer is over the shape and a mouse button is pressed. (Inherited from Shape.)
Public eventMouseEnterOccurs when the mouse pointer enters the shape. (Inherited from Shape.)
Public eventMouseHoverOccurs when the mouse pointer rests on the shape. (Inherited from Shape.)
Public eventMouseLeaveOccurs when the mouse pointer leaves the shape. (Inherited from Shape.)
Public eventMouseMoveOccurs when the mouse pointer is moved over the shape. (Inherited from Shape.)
Public eventMouseUpOccurs when the mouse pointer is over the shape and a mouse button is released. (Inherited from Shape.)
Public eventMouseWheelOccurs when the mouse wheel moves and the shape has focus. (Inherited from Shape.)
Public eventMoveOccurs when the shape is moved. (Inherited from Shape.)
Public eventPaintOccurs when the shape is redrawn. (Inherited from Shape.)
Public eventParentChangedOccurs when the Parent property value changes. (Inherited from Shape.)
Public eventPreviewKeyDownOccurs before the KeyDown event when a key is pressed and focus is on the shape. (Inherited from Shape.)
Public eventQueryAccessibilityHelpOccurs when an AccessibleObject is providing Help to accessibility applications. (Inherited from Shape.)
Public eventRegionChangedOccurs when the value of the Region property changes. (Inherited from Shape.)
Public eventResizeOccurs when the size of a shape is changed. (Inherited from SimpleShape.)
Public eventSizeChangedOccurs when the Size property of a shape is changed. (Inherited from SimpleShape.)
Public eventVisibleChangedOccurs when the Visible property value changes. (Inherited from Shape.)
Top

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.

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;
}
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.