Поделиться через


OvalShape - конструктор (Int32, Int32, Int32, Int32)

Инициализирует новый экземпляр OvalShape класс, указав его расположение и размер.

Пространство имен:  Microsoft.VisualBasic.PowerPacks
Сборка:  Microsoft.VisualBasic.PowerPacks.Vs (в Microsoft.VisualBasic.PowerPacks.Vs.dll)

Синтаксис

'Декларация
Public Sub New ( _
    left As Integer, _
    top As Integer, _
    width As Integer, _
    height As Integer _
)
public OvalShape(
    int left,
    int top,
    int width,
    int height
)
public:
OvalShape(
    int left, 
    int top, 
    int width, 
    int height
)
new : 
        left:int * 
        top:int * 
        width:int * 
        height:int -> OvalShape
public function OvalShape(
    left : int, 
    top : int, 
    width : int, 
    height : int
)

Параметры

  • width
    Тип: System.Int32
    Integer представляющее ширину (в точках) OvalShape.
  • height
    Тип: System.Int32
    Integer представляющее высоту (в точках) OvalShape.

Заметки

OvalShape элемент управления не удается отобразить непосредственно в форме или контейнерном элементе управления; он должен содержать a ShapeContainer объект.После инициализации OvalShapeможно установить его Parent свойство то к существующим ShapeContainer или к новому экземпляру ShapeContainer.

Примеры

В следующем примере создается a ShapeContainer и OvalShapeдобавляет их в форме и круг диаметра 100 точек.

Private Sub DrawCircle2()
    Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
    ' Declare an OvalShape and set the location and size.
    Dim oval1 As New Microsoft.VisualBasic.PowerPacks.OvalShape(20, 20,
      120, 120)
    ' Set the form as the parent of the ShapeContainer.
    canvas.Parent = Me
    ' Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas
End Sub
private void DrawCircle2()
{
    Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
        new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
    // Declare an OvalShape and set the location and size.
    Microsoft.VisualBasic.PowerPacks.OvalShape oval1 = 
        new Microsoft.VisualBasic.PowerPacks.OvalShape(20, 20, 120, 120);
    // Set the form as the parent of the ShapeContainer.
    canvas.Parent = this;
    // Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas;
}

Безопасность платформы .NET Framework

См. также

Ссылки

OvalShape Класс

OvalShape - перегрузка

Microsoft.VisualBasic.PowerPacks - пространство имен

Другие ресурсы

Знакомство с элементами управления Line и Shape (Visual Studio)

Пошаговое руководство. Изображение линий при помощи элемента управления LineShape (Visual Studio)

Пошаговое руководство. Рисование фигур при помощи элементов управления OvalShape и RectangleShape (Visual Studio)