Konstruktor OvalShape — (Int32, Int32, Int32, Int32)
Inicjuje nowe wystąpienie OvalShape klasy, określając jego lokalizacja i rozmiar.
Przestrzeń nazw: Microsoft.VisualBasic.PowerPacks
Zestaw: Microsoft.VisualBasic.PowerPacks.Vs (w Microsoft.VisualBasic.PowerPacks.Vs.dll)
Składnia
'Deklaracja
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
)
Parametry
- left
Typ: Int32
- top
Typ: Int32
width
Typ: Int32Integer Liczbową wartość odzwierciedlającą szerokość (w pikselach) OvalShape.
height
Typ: Int32Integer Liczbową wartość odzwierciedlającą wysokość (w pikselach) OvalShape.
Uwagi
OvalShape Formantu nie można wyświetlić bezpośrednio w formancie formularza lub kontenera; muszą być zawarte w ShapeContainer obiektu.Po należy zainicjować OvalShape, musisz ustawić jej Parent właściwość albo do istniejącego ShapeContainer lub do nowego wystąpienia programu ShapeContainer.
Przykłady
Poniższy przykład tworzy ShapeContainer i OvalShape, a następnie dodaje je do formularza i wyświetla okręgu o średnicy 100 pikseli.
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;
}
Zabezpieczenia programu .NET Framework
- Pełne zaufanie do bezpośredniego wywołującego. Tego elementu członkowskiego nie można używać w kodzie częściowo zaufanym. Aby uzyskać więcej informacji, zobacz Używanie bibliotek pochodzących z częściowo zaufanego kodu.
Zobacz też
Informacje
Przestrzeń nazw Microsoft.VisualBasic.PowerPacks
Inne zasoby
Linie i kształty — Wprowadzenie do formantów (Visual Studio)
Porady: rysowanie linii za pomocą formantów LineShape (Visual Studio)
Porady: rysowanie kształtów za pomocą formantów OvalShape i RectangleShape (Visual Studio)