ARTICLE

Line and Shape Controls and VB.NET 2008

Posted by Hirendra Sisodiya Articles | Windows Controls February 22, 2010
article describes about line and shape cintrol in vb.net
 
Reader Level:

         

Introduction to the Line and Shape Controls

 

Visual Basic power pack  controls allow us to draw lines, rectangle and oval shapes on your Windows Forms application. These controls accept many of the graphics methods of system. Drawing namespace. This enables you to draw lines and shapes in a single step without having to create graphics objects, pens, and brushes.

We can able to draw horizontal, vertical, and diagonal lines, rectangles, squares, ovals, circles, and rectangles and squares with the help of power pack  graphical controls. Now we discuss about and Shape Controls

Introduction to the Line and Shape Controls

The Visual Basic Power Packs Line and Shape controls are a set of three graphical controls that enable you to draw lines and shapes on forms and containers.

 LineShape  control -is used to draw horizontal, vertical, and diagonal lines.

  OvalShape  control is used to draw circles and ovals.

 RactangelShape control is used to draw rectangles and squares.

 

Shape   

             LineShape
        
 SimpleShape                       

                                      OvalShape       
                                      RactangleShape     

                                 

  •   Drag the  LineShape control from the Toolbox drag to a form or container control.
  •   Drag the sizing and move handles to size and position the line.

                                            -- ---Or-----

        Imports Microsoft.VisualBasic.PowerPacks

        Dim ShapeCon As New ShapeContainer

        Dim testLine As New LineShape

        ShapeCon.Parent = Me

        testLine.Parent = ShapeCon

        testLine.StartPoint = New System.Drawing.Point(10, 10)

        testLine.EndPoint = New System.Drawing.Point(300, 300)

Note: When any  Line or Shape control is added to a form or container, ShapeContainer object is created.

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Team Foundation Server Hosting
Become a Sponsor