Shape.Show Method ()

 

Displays a shape to the user.

Namespace:   Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

public void Show()

Showing the control is equivalent to setting the Visible property to true. After the Show method is called, the Visible property returns a value of true until the Hide method is called or until Visible is set to false.

The following example demonstrates how to use the Show and Hide methods to switch between two different shapes at run time. This example requires that you have a RectangleShape control named RectangleShape1 and an OvalShape control named OvalShape1 on a form. For best results, make both controls the same size and position one on top of the other.

private void Form1_Load(System.Object sender, System.EventArgs e)
{
    // Hide the oval.
    ovalShape1.Hide();
}

private void Shapes_Click(System.Object sender, System.EventArgs e)
{
    if (ovalShape1.Visible == true)
    // Hide the oval.
    {
        ovalShape1.Hide();
        // Show the rectangle.
        rectangleShape1.Show();
    }
    else
    {
        // Hide the rectangle.
        rectangleShape1.Hide();
        // Show the oval.
        ovalShape1.Show();
    }
}
Return to top
Show: