Per Mausklick bewerten und Feedback geben
MSDN
MSDN Library
.NET Entwicklung
.NET Framework 3.5
.NET Framework
Control-Klasse
Control-Methoden
 Show-Methode
Diese Seite ist spezifisch für
Microsoft Visual Studio 2008/.NET Framework 3.5

Andere Versionen stehen ebenfalls zur Verfügung für:
.NET Framework-Klassenbibliothek
Control..::.Show-Methode

Aktualisiert: November 2007

Zeigt dem Benutzer das Steuerelement an.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
Visual Basic (Deklaration)
Public Sub Show
Visual Basic (Verwendung)
Dim instance As Control

instance.Show()
C#
public void Show()
VisualC++
public:
void Show()
J#
public void Show()
Jscript
public function Show()

Das Anzeigen des Steuerelements entspricht dem Festlegen der Visible-Eigenschaft auf true. Nach dem Aufrufen der Show-Methode gibt die Visible-Eigenschaft den Wert true zurück, bis die Hide-Methode aufgerufen wird.

Im folgenden Codebeispiel wird ein Dialogfeld Info angezeigt und vorübergehend ein blaues Quadrat auf der Oberfläche des Felds gezeichnet. Für dieses Beispiel muss eine von Form abgeleitete Klasse mit dem Namen AboutDialog definiert sein.

Visual Basic
Private Sub menuItemHelpAbout_Click(sender As Object, _
  e As EventArgs) Handles menuItemHelpAbout.Click
   ' Create and display a modless about dialog box.
   Dim about As New AboutDialog()
   about.Show()

   ' Draw a blue square on the form.
   ' NOTE: This is not a persistent object, it will no longer be
   ' visible after the next call to OnPaint. To make it persistent, 
   ' override the OnPaint method and draw the square there 
   Dim g As Graphics = about.CreateGraphics()
   g.FillRectangle(Brushes.Blue, 10, 10, 50, 50)
End Sub

C#
private void menuItemHelpAbout_Click(object sender, EventArgs e)
{
   // Create and display a modless about dialog box.
   AboutDialog about = new AboutDialog();
   about.Show();

   // Draw a blue square on the form.
   /* NOTE: This is not a persistent object, it will no longer be
      * visible after the next call to OnPaint. To make it persistent, 
      * override the OnPaint method and draw the square there */
   Graphics g = about.CreateGraphics();
   g.FillRectangle(Brushes.Blue, 10, 10, 50, 50);
}

VisualC++
private:
   void menuItemHelpAbout_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Create and display a modeless about dialog box.
      AboutDialog^ about = gcnew AboutDialog;
      about->Show();

      // Draw a blue square on the form.
      /* NOTE: This is not a persistent object, it will no longer be
                  * visible after the next call to OnPaint. To make it persistent,
                  * override the OnPaint method and draw the square there */
      Graphics^ g = about->CreateGraphics();
      g->FillRectangle( Brushes::Blue, 10, 10, 50, 50 );
   }

J#
private void menuItemHelpAbout_Click(Object sender, EventArgs e)
{
    // Create and display a modless about dialog box.
    AboutDialog about = new AboutDialog();
    about.Show();

    // Draw a blue square on the form.
    /* NOTE: This is not a persistent object, it will no longer be
       visible after the next call to OnPaint. To make it persistent, 
       override the OnPaint method and draw the square there 
     */
    Graphics g = about.CreateGraphics();
    g.FillRectangle(Brushes.get_Blue(), 10, 10, 50, 50);
} //menuItemHelpAbout_Click

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile für Smartphone, Windows Mobile für Pocket PC

.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

.NET Framework

Unterstützt in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 3.5, 2.0, 1.0
Community Content   Was ist Community Content?
Neuen Inhalt hinzufügen RSS  Anmerkungen
Processing
Page view tracker