Control.Visible プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Control.Visible プロパティの意味・解説 

Control.Visible プロパティ

サーバー コントロールUI としてページ表示するかどうかを示す値を取得または設定します

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Control.Visible プロパティ

コントロール表示されているかどうかを示す値を取得または設定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

<LocalizableAttribute(True)> _
Public Property Visible As
 Boolean
Dim instance As Control
Dim value As Boolean

value = instance.Visible

instance.Visible = value
[LocalizableAttribute(true)] 
public bool Visible { get;
 set; }
[LocalizableAttribute(true)] 
public:
property bool Visible {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_Visible ()

/** @property */
public void set_Visible (boolean value)

プロパティ
コントロール表示されている場合trueそれ以外場合false既定値true です。

使用例使用例

派生クラス VScrollBar および HScrollBar を使用し、PictureBox コントロール内に表示されている Imageサイズ基づいて Visible プロパティ値を設定するコード例次に示します。この例では、フォーム上に PictureBox作成されており、PictureBox 上に HScrollBar コントロールおよび VScrollBar コントロール作成されていることが必要です。このコードは、イメージピクチャ ボックス読み込まれたときに、フォームの Resize イベントによって呼び出されます。

Public Sub DisplayScrollBars()
    ' Display or hide the scroll bars based upon  
    ' whether the image is larger than the PictureBox.
    If pictureBox1.Width > pictureBox1.Image.Width Then
        hScrollBar1.Visible = False
    Else
        hScrollBar1.Visible = True
    End If
    
    If pictureBox1.Height > pictureBox1.Image.Height Then
        vScrollBar1.Visible = False
    Else
        vScrollBar1.Visible = True
    End If
End Sub 'DisplayScrollBars
public void DisplayScrollBars()
 {
    // Display or hide the scroll bars based upon  
    // whether the image is larger than the PictureBox.
    if (pictureBox1.Width > pictureBox1.Image.Width)
    {
       hScrollBar1.Visible = false;
    }
    else
    {
       hScrollBar1.Visible = true;
    }
    
    if (pictureBox1.Height > pictureBox1.Image.Height)
    {
       vScrollBar1.Visible = false;
    }
    else
    {
       vScrollBar1.Visible = true;
    }
 }
 
public:
   void DisplayScrollBars()
   {
      // Display or hide the scroll bars based upon  
      // whether the image is larger than the PictureBox.
      if ( pictureBox1->Width > pictureBox1->Image->Width
 )
      {
         hScrollBar1->Visible = false;
      }
      else
      {
         hScrollBar1->Visible = true;
      }

      if ( pictureBox1->Height > pictureBox1->Image->Height
 )
      {
         vScrollBar1->Visible = false;
      }
      else
      {
         vScrollBar1->Visible = true;
      }
   }
public void DisplayScrollBars()
{
    // Display or hide the scroll bars based upon  
    // whether the image is larger than the PictureBox.
    if (pictureBox1.get_Width() > pictureBox1.get_Image().get_Width())
 {
        hScrollBar1.set_Visible(false);
    }
    else {
        hScrollBar1.set_Visible(true);
    }

    if (pictureBox1.get_Height() > pictureBox1.get_Image().get_Height())
 {
        vScrollBar1.set_Visible(false);
    }
    else {
        vScrollBar1.set_Visible(true);
    }
} //DisplayScrollBars
public function DisplayScrollBars()
 {
    // Display or hide the scroll bars based upon  
    // whether the image is larger than the PictureBox.
    if (pictureBox1.Width > pictureBox1.Image.Width)
    {
       hScrollBar1.Visible = false;
    }
    else
    {
       hScrollBar1.Visible = true;
    }
    
    if (pictureBox1.Height > pictureBox1.Image.Height)
    {
       vScrollBar1.Visible = false;
    }
    else
    {
       vScrollBar1.Visible = true;
    }
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Control.Visible プロパティ」の関連用語

Control.Visible プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Control.Visible プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS