다음을 통해 공유


Control.Show 메서드

정의

컨트롤을 사용자에게 표시합니다.

public:
 void Show();
public void Show ();
member this.Show : unit -> unit
Public Sub Show ()

예제

다음 코드 예제에서는 정보 대화 상자를 표시 하 고 일시적으로 표면에 파란색 사각형을 그립니다. 이 예제에서는 명명AboutDialog된 클래스에서 Form 파생되는 클래스를 정의해야 합니다.

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 );
   }
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);
}
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

설명

컨트롤을 표시하는 것은 속성을 .로 설정하는 Visible 것과 true같습니다. 메서드를 호출 VisibleShow 후 메서드가 호출될 때까지 Hidetrue 값을 반환합니다.

적용 대상

추가 정보