Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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();
    }
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.