Export (0) Print
Expand All

LineShape Class

Represents a control displayed as a horizontal, vertical, or diagonal line.

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

[ToolboxBitmapAttribute(typeof(LineShape), "Microsoft.VisualBasic.PowerPacks.LineShape.bmp")]
public class LineShape : Shape

The LineShape type exposes the following members.

  NameDescription
Public methodLineShape()Initializes a new instance of the LineShape class.
Public methodLineShape(ShapeContainer)Initializes a new instance of the LineShape class, specifying the ShapeContainer where it will be parented.
Public methodLineShape(Int32, Int32, Int32, Int32)Initializes a new instance of the LineShape class, specifying the coordinates for the line.
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 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 a line or shape control's border. (Inherited from Shape.)
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 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 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.)
Public propertyEndPointGets or sets the ending coordinates of a line drawn by a LineShape control.
Protected propertyEventsGets the list of event handlers that are attached to this Component. (Inherited from Component.)
Public propertyFocusedGets a value indicating whether a line or shape control currently has the input focus. (Inherited from Shape.)
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 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 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 propertyStartPointGets or sets the starting coordinates of a line drawn by a LineShape control.
Public propertyTagGets or sets the object that contains data about a line or shape control. (Inherited from Shape.)
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 propertyX1Gets or sets the X coordinate of the starting point of a line drawn by a LineShape control.
Public propertyX2Gets or sets the X coordinate of the ending point of a line drawn by a LineShape control.
Public propertyY1Gets or sets the Y coordinate of the starting point of a line drawn by a LineShape control.
Public propertyY2Gets or sets the Y coordinate of the ending point of a line drawn by a LineShape control.
Top

  NameDescription
Public methodBringToFrontBrings a line or shape control to the front of the z-order. (Inherited from Shape.)
Protected methodCreateAccessibilityInstanceCreates an object to provide information that accessibility applications use to adjust an application's user interface (UI) for users who have disabilities. (Overrides Shape.CreateAccessibilityInstance().)
Public methodCreateObjRefSecurity Critical. Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodDispose()Releases 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 drawing to the specified bitmap. (Overrides Shape.DrawToBitmap(Bitmap, Rectangle).)
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 the default hash function. (Inherited from Object.)
Public methodGetLifetimeServiceSecurity Critical. Retrieves 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 methodHitTestGets information about the LineShape control at the specified point on the screen. (Overrides Shape.HitTest(Int32, Int32).)
Public methodInitializeLifetimeServiceSecurity Critical. Obtains 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 methodMemberwiseClone()Creates 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 methodOnClickRaises the Click event. (Inherited from Shape.)
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 methodOnEndPointChangedRaises the EndPointChanged event.
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 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. (Overrides Shape.OnPaint(PaintEventArgs).)
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 methodOnStartPointChangedRaises the StartPointChanged event.
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 methodScaleResizes the LineShape control by the specified scaling factor. (Overrides Shape.Scale(SizeF).)
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 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 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 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 eventEndPointChangedOccurs when the EndPoint property value changes.
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 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 eventStartPointChangedOccurs when the StartPoint property value changes.
Public eventVisibleChangedOccurs when the Visible property value changes. (Inherited from Shape.)
Top

The LineShape control enables you to draw lines 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.

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

The following example creates a ShapeContainer and a LineShape, adds them to a form, and displays a vertical line from the top to the bottom of the form.

Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
    new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
Microsoft.VisualBasic.PowerPacks.LineShape line1 = 
    new Microsoft.VisualBasic.PowerPacks.LineShape();
// Set the form as the parent of the ShapeContainer.
canvas.Parent = this;
// Set the ShapeContainer as the parent of the LineShape.
line1.Parent = canvas;
// Set the starting and ending coordinates for the line.
line1.StartPoint = new System.Drawing.Point(this.Width / 2, 0);
line1.EndPoint = new System.Drawing.Point(this.Width / 2, this.Height);

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