OvalShape, classe

Mise à jour : novembre 2007

Représente un contrôle affiché sous forme de cercle ou d'ovale.

Espace de noms :  Microsoft.VisualBasic.PowerPacks
Assembly :  Microsoft.VisualBasic.PowerPacks.Vs (dans Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntaxe

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

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

Notes

Le contrôle OvalShape vous permet de dessiner des cercles et des ovales sur un formulaire ou un conteneur au moment du design ou de l'exécution.

Lorsque vous ajoutez un contrôle Line ou Shape à un formulaire ou un conteneur, un objet ShapeContainer invisible est créé. Le ShapeContainer sert de surface de dessin pour les formes au sein de chaque contrôle conteneur. Chaque ShapeContainer possède un ShapeCollection correspondant qui vous permet de parcourir les contrôles Line et Shape contenus dans le ShapeContainer.

Lorsque vous créez un contrôle OvalShape au moment de l'exécution, vous devez également créer un ShapeContainer et définir la propriété Parent de OvalShape sur ShapeContainer.

Exemples

L'exemple suivant crée un ShapeContainer et un OvalShape, les ajoute à un formulaire et affiche un cercle.

Private Sub DrawCircle()
    Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
    Dim oval1 As New Microsoft.VisualBasic.PowerPacks.OvalShape
    ' Set the form as the parent of the ShapeContainer.
    canvas.Parent = Me
    ' Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas
    ' Set the location and size of the circle.
    oval1.Left = 10
    oval1.Top = 10
    oval1.Width = 100
    oval1.Height = 100
End Sub
private void DrawCircle1()
{
    Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
        new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
    Microsoft.VisualBasic.PowerPacks.OvalShape oval1 = 
        new Microsoft.VisualBasic.PowerPacks.OvalShape();
    // Set the form as the parent of the ShapeContainer.
    canvas.Parent = this;
    // Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas;
    // Set the location and size of the circle.
    oval1.Left = 10;
    oval1.Top = 10;
    oval1.Width = 100;
    oval1.Height = 100;
}

Hiérarchie d'héritage

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      Microsoft.VisualBasic.PowerPacks.Shape
        Microsoft.VisualBasic.PowerPacks.SimpleShape
          Microsoft.VisualBasic.PowerPacks.OvalShape

Sécurité des threads

Tous les membres static (Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Voir aussi

Référence

Membres OvalShape

Microsoft.VisualBasic.PowerPacks, espace de noms

Autres ressources

Introduction aux contrôles Line et Shape (Visual Studio)

Comment : dessiner des lignes avec le contrôle LineShape (Visual Studio)

Comment : dessiner des formes avec les contrôles OvalShape et RectangleShape (Visual Studio)