다음을 통해 공유


LineShape 클래스

업데이트: 2007년 11월

가로선, 세로선 또는 대각선으로 표시되는 컨트롤을 나타냅니다.

네임스페이스:  Microsoft.VisualBasic.PowerPacks
어셈블리:  Microsoft.VisualBasic.PowerPacks.Vs(Microsoft.VisualBasic.PowerPacks.Vs.dll)

구문

<ToolboxBitmapAttribute(GetType(LineShape), "Microsoft.VisualBasic.PowerPacks.LineShape.bmp")> _
Public Class LineShape _
    Inherits Shape

Dim instance As LineShape
[ToolboxBitmapAttribute(typeof(LineShape), "Microsoft.VisualBasic.PowerPacks.LineShape.bmp")]
public class LineShape : Shape
[ToolboxBitmapAttribute(typeof(LineShape), L"Microsoft.VisualBasic.PowerPacks.LineShape.bmp")]
public ref class LineShape : public Shape
public class LineShape extends Shape

설명

LineShape 컨트롤을 사용하여 디자인 타임이나 런타임에 폼 또는 컨테이너에 선을 그릴 수 있습니다.

폼이나 컨테이너에 Line 또는 Shape 컨트롤을 추가하면 보이지 않는 ShapeContainer 개체가 생성됩니다. ShapeContainer는 각 컨테이너 컨트롤 내에서 도형에 대한 그리기 화면으로 사용됩니다. 각 ShapeContainer에는 Line 및 Shape 컨트롤을 반복하는 데 사용할 수 있는 해당하는 ShapeCollection이 있습니다.

런타임에 LineShape 컨트롤을 만드는 경우 ShapeContainer도 만들고 LineShape의 Parent 속성을 ShapeContainer로 설정해야 합니다.

예제

다음 예제에서는 ShapeContainer와 LineShape를 만들어 폼의 맨 위에서 맨 아래까지 수직선을 표시합니다.

Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
Dim line1 As New Microsoft.VisualBasic.PowerPacks.LineShape
' Set the form as the parent of the ShapeContainer.
canvas.Parent = Me
' 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(Me.Width / 2, 0)
line1.EndPoint = New System.Drawing.Point(Me.Width / 2, Me.Height)
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);

상속 계층 구조

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      Microsoft.VisualBasic.PowerPacks.Shape
        Microsoft.VisualBasic.PowerPacks.LineShape

스레드로부터의 안전성

이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

참고 항목

참조

LineShape 멤버

Microsoft.VisualBasic.PowerPacks 네임스페이스

ShapeContainer

Shape

기타 리소스

방법: OvalShape 및 RectangleShape 컨트롤을 사용하여 도형 그리기(Visual Studio)

방법: LineShape 컨트롤로 선 그리기(Visual Studio)

Line 및 Shape 컨트롤 소개(Visual Studio)