Control.Hide 메서드

정의

사용자에게 컨트롤을 숨깁니다.

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

예제

다음 코드 예제에서는 단추를 클릭할 때 Ctrl 키를 누르면 단추를 숨깁니다. 이 예제에서는 이름이 .에 Button 있어야 합니다Form.button1

private:
   void button1_Click( Object^ sender, System::EventArgs^ /*e*/ )
   {
      /* If the CTRL key is pressed when the
         * control is clicked, hide the control. */
      if ( Control::ModifierKeys == Keys::Control )
      {
         (dynamic_cast<Control^>(sender))->Hide();
      }
   }
private void button1_Click(object sender, System.EventArgs e)
{
   /* If the CTRL key is pressed when the 
      * control is clicked, hide the control. */
   if(Control.ModifierKeys == Keys.Control)
   {
      ((Control)sender).Hide();
   }
}
Private Sub button1_Click(sender As Object, _
  e As EventArgs) Handles button1.Click
   ' If the CTRL key is pressed when the 
   ' control is clicked, hide the control. 
   If Control.ModifierKeys = Keys.Control Then
      CType(sender, Control).Hide()
   End If
End Sub

설명

컨트롤을 숨기는 것은 속성을 .로 설정하는 Visible 것과 false같습니다. 메서드를 Hide 호출한 후 메서드가 Visible 호출될 때까지의 false 값을 반환합니다 Show .

적용 대상

추가 정보