ShapeContainer Class

 

Provides a container for LineShape, OvalShape, RectangleShape controls, and for any other control that derives from Shape.

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

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.Windows.Forms.Control
        System.Windows.Forms.ScrollableControl
          System.Windows.Forms.ContainerControl
            System.Windows.Forms.UserControl
              Microsoft.VisualBasic.PowerPacks.ShapeContainer

[BrowsableAttribute(false)]
public sealed class ShapeContainer : UserControl

NameDescription
System_CAPS_pubmethodShapeContainer()

Initializes a new instance of the ShapeContainer class.

NameDescription
System_CAPS_pubpropertyAccessibilityObject

(Inherited from Control.)

System_CAPS_pubpropertyAccessibleDefaultActionDescription

(Inherited from Control.)

System_CAPS_pubpropertyAccessibleDescription

(Inherited from Control.)

System_CAPS_pubpropertyAccessibleName

(Inherited from Control.)

System_CAPS_pubpropertyAccessibleRole

Gets or sets the accessible role of the ShapeContainer.

System_CAPS_pubpropertyActiveControl

(Inherited from ContainerControl.)

System_CAPS_pubpropertyAllowDrop

(Inherited from Control.)

System_CAPS_pubpropertyAnchor

(Inherited from Control.)

System_CAPS_pubpropertyAutoScaleDimensions

(Inherited from ContainerControl.)

System_CAPS_pubpropertyAutoScaleMode

(Inherited from ContainerControl.)

System_CAPS_pubpropertyAutoScroll

(Inherited from ScrollableControl.)

System_CAPS_pubpropertyAutoScrollMargin

(Inherited from ScrollableControl.)

System_CAPS_pubpropertyAutoScrollMinSize

(Inherited from ScrollableControl.)

System_CAPS_pubpropertyAutoScrollOffset

(Inherited from Control.)

System_CAPS_pubpropertyAutoScrollPosition

(Inherited from ScrollableControl.)

System_CAPS_pubpropertyAutoSize

(Inherited from UserControl.)

System_CAPS_pubpropertyAutoSizeMode

(Inherited from UserControl.)

System_CAPS_pubpropertyAutoValidate

(Inherited from UserControl.)

System_CAPS_pubpropertyBackColor

(Inherited from Control.)

System_CAPS_pubpropertyBackgroundImage

(Inherited from Control.)

System_CAPS_pubpropertyBackgroundImageLayout

(Inherited from Control.)

System_CAPS_pubpropertyBindingContext

(Inherited from ContainerControl.)

System_CAPS_pubpropertyBorderStyle

(Inherited from UserControl.)

System_CAPS_pubpropertyBottom

(Inherited from Control.)

System_CAPS_pubpropertyBounds

(Inherited from Control.)

System_CAPS_pubpropertyCanFocus

(Inherited from Control.)

System_CAPS_pubpropertyCanSelect

(Inherited from Control.)

System_CAPS_pubpropertyCapture

(Inherited from Control.)

System_CAPS_pubpropertyCausesValidation

(Inherited from Control.)

System_CAPS_pubpropertyClientRectangle

(Inherited from Control.)

System_CAPS_pubpropertyClientSize

(Inherited from Control.)

System_CAPS_pubpropertyCompanyName

(Inherited from Control.)

System_CAPS_pubpropertyContainer

(Inherited from Component.)

System_CAPS_pubpropertyContainsFocus

(Inherited from Control.)

System_CAPS_pubpropertyContextMenu

(Inherited from Control.)

System_CAPS_pubpropertyContextMenuStrip

(Inherited from Control.)

System_CAPS_pubpropertyControls

(Inherited from Control.)

System_CAPS_pubpropertyCreated

(Inherited from Control.)

System_CAPS_pubpropertyCurrentAutoScaleDimensions

(Inherited from ContainerControl.)

System_CAPS_pubpropertyCursor

Gets or sets the cursor that is displayed when the mouse pointer is over a ShapeContainer.(Overrides Control.Cursor.)

System_CAPS_pubpropertyDataBindings

(Inherited from Control.)

System_CAPS_pubpropertyDisplayRectangle

(Inherited from ScrollableControl.)

System_CAPS_pubpropertyDisposing

(Inherited from Control.)

System_CAPS_pubpropertyDock

Gets or sets which control borders are docked to the parent control and determines how a control is resized when its parent is resized.(Overrides Control.Dock.)

System_CAPS_pubpropertyEnabled

(Inherited from Control.)

System_CAPS_pubpropertyFocused

(Inherited from Control.)

System_CAPS_pubpropertyFont

(Inherited from Control.)

System_CAPS_pubpropertyForeColor

(Inherited from Control.)

System_CAPS_pubpropertyHandle

(Inherited from Control.)

System_CAPS_pubpropertyHasChildren

(Inherited from Control.)

System_CAPS_pubpropertyHeight

(Inherited from Control.)

System_CAPS_pubpropertyHorizontalScroll

(Inherited from ScrollableControl.)

System_CAPS_pubpropertyImeMode

(Inherited from Control.)

System_CAPS_pubpropertyInvokeRequired

(Inherited from Control.)

System_CAPS_pubpropertyIsAccessible

(Inherited from Control.)

System_CAPS_pubpropertyIsDisposed

(Inherited from Control.)

System_CAPS_pubpropertyIsHandleCreated

(Inherited from Control.)

System_CAPS_pubpropertyIsMirrored

(Inherited from Control.)

System_CAPS_pubpropertyLayoutEngine

(Inherited from Control.)

System_CAPS_pubpropertyLeft

(Inherited from Control.)

System_CAPS_pubpropertyLocation

(Inherited from Control.)

System_CAPS_pubpropertyMargin

(Inherited from Control.)

System_CAPS_pubpropertyMaximumSize

(Inherited from Control.)

System_CAPS_pubpropertyMinimumSize

(Inherited from Control.)

System_CAPS_pubpropertyName

(Inherited from Control.)

System_CAPS_pubpropertyPadding

(Inherited from Control.)

System_CAPS_pubpropertyParent

(Inherited from Control.)

System_CAPS_pubpropertyParentForm

(Inherited from ContainerControl.)

System_CAPS_pubpropertyPreferredSize

(Inherited from Control.)

System_CAPS_pubpropertyProductName

(Inherited from Control.)

System_CAPS_pubpropertyProductVersion

(Inherited from Control.)

System_CAPS_pubpropertyRecreatingHandle

(Inherited from Control.)

System_CAPS_pubpropertyRegion

(Inherited from Control.)

System_CAPS_protpropertyRenderRightToLeft

(Inherited from Control.)

System_CAPS_pubpropertyRight

(Inherited from Control.)

System_CAPS_pubpropertyRightToLeft

(Inherited from Control.)

System_CAPS_pubpropertyShapes

Gets the collection of shapes that are contained in the ShapeContainer.

System_CAPS_protpropertyShowFocusCues

(Inherited from Control.)

System_CAPS_protpropertyShowKeyboardCues

(Inherited from Control.)

System_CAPS_pubpropertySite

(Inherited from Control.)

System_CAPS_pubpropertySize

(Inherited from Control.)

System_CAPS_pubpropertyTabIndex

(Inherited from Control.)

System_CAPS_pubpropertyTabStop

(Inherited from Control.)

System_CAPS_pubpropertyTag

(Inherited from Control.)

System_CAPS_pubpropertyText

(Inherited from Control.)

System_CAPS_pubpropertyTop

(Inherited from Control.)

System_CAPS_pubpropertyTopLevelControl

(Inherited from Control.)

System_CAPS_pubpropertyUseWaitCursor

(Inherited from Control.)

System_CAPS_pubpropertyVerticalScroll

(Inherited from ScrollableControl.)

System_CAPS_pubpropertyVisible

(Inherited from Control.)

System_CAPS_pubpropertyWidth

(Inherited from Control.)

NameDescription
System_CAPS_protmethodAccessibilityNotifyClients(AccessibleEvents, Int32)

(Inherited from Control.)

System_CAPS_pubmethodBeginInvoke(Delegate)

(Inherited from Control.)

System_CAPS_pubmethodBeginInvoke(Delegate, Object[])

(Inherited from Control.)

System_CAPS_pubmethodBringToFront()

(Inherited from Control.)

System_CAPS_pubmethodContains(Control)

(Inherited from Control.)

System_CAPS_pubmethodCreateControl()

(Inherited from Control.)

System_CAPS_pubmethodCreateGraphics()

(Inherited from Control.)

System_CAPS_pubmethodCreateObjRef(Type)

(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodDispose()

(Inherited from Component.)

System_CAPS_pubmethodDoDragDrop(Object, DragDropEffects)

(Inherited from Control.)

System_CAPS_pubmethodDrawToBitmap(Bitmap, Rectangle)

(Inherited from Control.)

System_CAPS_pubmethodEndInvoke(IAsyncResult)

(Inherited from Control.)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodFindForm()

(Inherited from Control.)

System_CAPS_pubmethodFocus()

(Inherited from Control.)

System_CAPS_pubmethodGetChildAtPoint(Point)

Gets the shape that is located at the specified coordinates.

System_CAPS_pubmethodGetChildAtPoint(Point, GetChildAtPointSkip)

(Inherited from Control.)

System_CAPS_pubmethodGetContainerControl()

(Inherited from Control.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetLifetimeService()

(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodGetNextControl(Control, Boolean)

(Inherited from Control.)

System_CAPS_pubmethodGetNextShape(Shape, Boolean)

Retrieves the next or previous shape in the order of the ShapeCollection.

System_CAPS_pubmethodGetPreferredSize(Size)

(Inherited from Control.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodHide()

(Inherited from Control.)

System_CAPS_pubmethodInitializeLifetimeService()

(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodInvalidate()

(Inherited from Control.)

System_CAPS_pubmethodInvalidate(Boolean)

(Inherited from Control.)

System_CAPS_pubmethodInvalidate(Rectangle)

(Inherited from Control.)

System_CAPS_pubmethodInvalidate(Rectangle, Boolean)

(Inherited from Control.)

System_CAPS_pubmethodInvalidate(Region)

(Inherited from Control.)

System_CAPS_pubmethodInvalidate(Region, Boolean)

(Inherited from Control.)

System_CAPS_pubmethodInvoke(Delegate)

(Inherited from Control.)

System_CAPS_pubmethodInvoke(Delegate, Object[])

(Inherited from Control.)

System_CAPS_pubmethodPerformAutoScale()

(Inherited from ContainerControl.)

System_CAPS_pubmethodPerformLayout()

(Inherited from Control.)

System_CAPS_pubmethodPerformLayout(Control, String)

(Inherited from Control.)

System_CAPS_pubmethodPointToClient(Point)

(Inherited from Control.)

System_CAPS_pubmethodPointToScreen(Point)

(Inherited from Control.)

System_CAPS_pubmethodPreProcessControlMessage(Message)

(Inherited from Control.)

System_CAPS_pubmethodPreProcessMessage(Message)

(Inherited from Control.)

System_CAPS_protmethodProcessKeyMessage(Message)

(Inherited from Control.)

System_CAPS_protmethodProcessMnemonic(Char)

(Inherited from ContainerControl.)

System_CAPS_pubmethodRectangleToClient(Rectangle)

(Inherited from Control.)

System_CAPS_pubmethodRectangleToScreen(Rectangle)

(Inherited from Control.)

System_CAPS_pubmethodRefresh()

(Inherited from Control.)

System_CAPS_pubmethodResetText()

(Inherited from Control.)

System_CAPS_pubmethodResumeLayout()

(Inherited from Control.)

System_CAPS_pubmethodResumeLayout(Boolean)

(Inherited from Control.)

System_CAPS_protmethodRtlTranslateContent(ContentAlignment)

(Inherited from Control.)

System_CAPS_pubmethodScale(SizeF)

(Inherited from Control.)

System_CAPS_pubmethodScrollControlIntoView(Control)

(Inherited from ScrollableControl.)

System_CAPS_pubmethodSelect()

(Inherited from Control.)

System_CAPS_pubmethodSelectNextControl(Control, Boolean, Boolean, Boolean, Boolean)

(Inherited from Control.)

System_CAPS_pubmethodSelectNextShape(Shape, Boolean, Boolean)

Selects the next or previous shape in the order of the ShapeCollection.

System_CAPS_pubmethodSendToBack()

(Inherited from Control.)

System_CAPS_pubmethodSetAutoScrollMargin(Int32, Int32)

(Inherited from ScrollableControl.)

System_CAPS_pubmethodSetBounds(Int32, Int32, Int32, Int32)

(Inherited from Control.)

System_CAPS_pubmethodSetBounds(Int32, Int32, Int32, Int32, BoundsSpecified)

(Inherited from Control.)

System_CAPS_pubmethodShow()

(Inherited from Control.)

System_CAPS_pubmethodSuspendLayout()

(Inherited from Control.)

System_CAPS_pubmethodToString()

(Inherited from Component.)

System_CAPS_pubmethodUpdate()

(Inherited from Control.)

System_CAPS_protmethodUpdateBounds()

(Inherited from Control.)

System_CAPS_pubmethodValidate()

(Inherited from ContainerControl.)

System_CAPS_pubmethodValidate(Boolean)

(Inherited from ContainerControl.)

System_CAPS_pubmethodValidateChildren()

(Inherited from UserControl.)

System_CAPS_pubmethodValidateChildren(ValidationConstraints)

(Inherited from UserControl.)

NameDescription
System_CAPS_pubeventAutoSizeChanged

(Inherited from UserControl.)

System_CAPS_pubeventAutoValidateChanged

(Inherited from UserControl.)

System_CAPS_pubeventBackColorChanged

(Inherited from Control.)

System_CAPS_pubeventBackgroundImageChanged

(Inherited from Control.)

System_CAPS_pubeventBackgroundImageLayoutChanged

(Inherited from Control.)

System_CAPS_pubeventBindingContextChanged

(Inherited from Control.)

System_CAPS_pubeventCausesValidationChanged

(Inherited from Control.)

System_CAPS_pubeventChangeUICues

(Inherited from Control.)

System_CAPS_pubeventClick

(Inherited from Control.)

System_CAPS_pubeventClientSizeChanged

(Inherited from Control.)

System_CAPS_pubeventContextMenuChanged

(Inherited from Control.)

System_CAPS_pubeventContextMenuStripChanged

(Inherited from Control.)

System_CAPS_pubeventControlAdded

(Inherited from Control.)

System_CAPS_pubeventControlRemoved

(Inherited from Control.)

System_CAPS_pubeventCursorChanged

(Inherited from Control.)

System_CAPS_pubeventDisposed

(Inherited from Component.)

System_CAPS_pubeventDockChanged

(Inherited from Control.)

System_CAPS_pubeventDoubleClick

(Inherited from Control.)

System_CAPS_pubeventDragDrop

(Inherited from Control.)

System_CAPS_pubeventDragEnter

(Inherited from Control.)

System_CAPS_pubeventDragLeave

(Inherited from Control.)

System_CAPS_pubeventDragOver

(Inherited from Control.)

System_CAPS_pubeventEnabledChanged

(Inherited from Control.)

System_CAPS_pubeventEnter

(Inherited from Control.)

System_CAPS_pubeventFontChanged

(Inherited from Control.)

System_CAPS_pubeventForeColorChanged

(Inherited from Control.)

System_CAPS_pubeventGiveFeedback

(Inherited from Control.)

System_CAPS_pubeventGotFocus

(Inherited from Control.)

System_CAPS_pubeventHandleCreated

(Inherited from Control.)

System_CAPS_pubeventHandleDestroyed

(Inherited from Control.)

System_CAPS_pubeventHelpRequested

(Inherited from Control.)

System_CAPS_pubeventImeModeChanged

(Inherited from Control.)

System_CAPS_pubeventInvalidated

(Inherited from Control.)

System_CAPS_pubeventKeyDown

(Inherited from Control.)

System_CAPS_pubeventKeyPress

(Inherited from Control.)

System_CAPS_pubeventKeyUp

(Inherited from Control.)

System_CAPS_pubeventLayout

(Inherited from Control.)

System_CAPS_pubeventLeave

(Inherited from Control.)

System_CAPS_pubeventLoad

(Inherited from UserControl.)

System_CAPS_pubeventLocationChanged

(Inherited from Control.)

System_CAPS_pubeventLostFocus

(Inherited from Control.)

System_CAPS_pubeventMarginChanged

(Inherited from Control.)

System_CAPS_pubeventMouseCaptureChanged

(Inherited from Control.)

System_CAPS_pubeventMouseClick

(Inherited from Control.)

System_CAPS_pubeventMouseDoubleClick

(Inherited from Control.)

System_CAPS_pubeventMouseDown

(Inherited from Control.)

System_CAPS_pubeventMouseEnter

(Inherited from Control.)

System_CAPS_pubeventMouseHover

(Inherited from Control.)

System_CAPS_pubeventMouseLeave

(Inherited from Control.)

System_CAPS_pubeventMouseMove

(Inherited from Control.)

System_CAPS_pubeventMouseUp

(Inherited from Control.)

System_CAPS_pubeventMouseWheel

(Inherited from Control.)

System_CAPS_pubeventMove

(Inherited from Control.)

System_CAPS_pubeventPaddingChanged

(Inherited from Control.)

System_CAPS_pubeventPaint

(Inherited from Control.)

System_CAPS_pubeventParentChanged

(Inherited from Control.)

System_CAPS_pubeventPreviewKeyDown

(Inherited from Control.)

System_CAPS_pubeventQueryAccessibilityHelp

(Inherited from Control.)

System_CAPS_pubeventQueryContinueDrag

(Inherited from Control.)

System_CAPS_pubeventRegionChanged

(Inherited from Control.)

System_CAPS_pubeventResize

(Inherited from Control.)

System_CAPS_pubeventRightToLeftChanged

(Inherited from Control.)

System_CAPS_pubeventScroll

(Inherited from ScrollableControl.)

System_CAPS_pubeventSizeChanged

(Inherited from Control.)

System_CAPS_pubeventStyleChanged

(Inherited from Control.)

System_CAPS_pubeventSystemColorsChanged

(Inherited from Control.)

System_CAPS_pubeventTabIndexChanged

(Inherited from Control.)

System_CAPS_pubeventTabStopChanged

(Inherited from Control.)

System_CAPS_pubeventTextChanged

(Inherited from Control.)

System_CAPS_pubeventValidated

(Inherited from Control.)

System_CAPS_pubeventValidating

(Inherited from Control.)

System_CAPS_pubeventVisibleChanged

(Inherited from Control.)

A LineShape, OvalShape, or RectangleShape control can be contained only in a ShapeContainer object, which acts as a canvas for line and shape controls.

When you add a line or shape to a form or container at design time, a ShapeContainer is automatically created if one does not already exist. The Parent property of the line or shape is set to that ShapeContainer. The Parent property of the ShapeContainer is set to the form or container control to which the line or shape was added.

When you create a line or shape at run time by using the New method, the control's Parent property must be set to a ShapeContainer. If a ShapeContainer already exists for the form or container, you should set the Parent property to that ShapeContainer. If no ShapeContainer exists, you can create a ShapeContainer by using the New method and set its Parent property to the form or container.

System_CAPS_noteNote

Be careful that you do not create more than one ShapeContainer for each form or container; doing this may introduce unexpected behavior. If you add a design-time line or shape control to a form or container after you write code to create one programmatically, you should modify that code to use the ShapeContainer created by the designer.

The following example checks for an existing ShapeContainer and sets the Parent property of an OvalShape control created at run time by using the New method.

private void form1_Load(System.Object sender, System.EventArgs e)
{
    OvalShape NewOval = new OvalShape();
    int i;
    bool found = false;
    // Loop through the Controls collection.
    for (i = 0; i < this.Controls.Count; i++)
    {
        // If a ShapeContainer is found, make it the parent.
        if (this.Controls[i] is ShapeContainer)
        {
            NewOval.Parent = ((ShapeContainer)this.Controls[i]);
            found = true;
            break;
        }
    }
    // If no ShapeContainer is found, create one and set the parents.
    if (found == false)
    {
        ShapeContainer sc = new ShapeContainer();
        sc.Parent = this;
        NewOval.Parent = sc;
    }
    NewOval.Size = new Size(200, 300);
}

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

Return to top
Show: