Control.Show メソッドとは? わかりやすく解説

Control.Show メソッド

コントロールユーザーに対して表示します

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

解説解説
使用例使用例

説明ダイアログ ボックス表示して、その表面に青い正方形一時的に描画するコード例次に示します。この例では、Form から派生した AboutDialog という名前のクラス定義されていることが必要です。

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
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:
   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.get_Blue(), 10, 10, 50, 50);
} //menuItemHelpAbout_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Control.Show メソッド」の関連用語

Control.Show メソッドのお隣キーワード
検索ランキング

   

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



Control.Show メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS