Form.Opacity プロパティとは何? わかりやすく解説 Weblio辞書

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

Form.Opacity プロパティ

フォーム不透明度取得または設定します

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

解説解説

Opacity プロパティ使用すると、フォームとそのコントロール透明度指定できます。このプロパティ100% (1.00) 未満の値に設定されると、境界線を含むフォーム全体透明度上がります。このプロパティが 0% (0.00) の値に設定されると、フォームは完全に見えなくなります。このプロパティ使用してさまざまな透明度指定することや、フォーム徐々に見えるようにしたり見えなくなるようにしたりする効果指定できます。たとえば、フォーム徐々に見えるようにするためには、Opacity プロパティを 0% (0.00) の値に設定し100% (1.00) に達するまで値を徐々に増やしていきます

Opacity は、TransparencyKey で指定される透明度とは異なりますTransparencyKey プロパティ場合は、フォームおよびコントロールの色がこのプロパティ指定した色と同じ場合に、それらのフォームおよびプロパティを完全に透明にするだけです。

RightToLeftLayout が true場合、このプロパティサポートされません。

Opacity プロパティは、Windows 2000導入されレイヤード ウィンドウ API依存してます。詳細については、http://msdn.microsoft.com にあるプラットフォーム SDK に関するドキュメントの「Layered Windows: A New Way to Use Translucency and Transparency Effects in Windows Applications」を参照してください

Windows 2000, Windows 2000 Professional, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional x64 Edition, Windows Server 2003 プラットフォームメモ : これらのプラットフォームレイヤード ウィンドウ APIサポートしてます。このプロパティは、レイヤード ウィンドウ表示できないプラットフォームでは無効です。また、一部ディスプレイ ドライバレイヤ表示サポートしていません。

使用例使用例

不透明度 75% で表示されるフォーム作成する方法次のコード例示します。このコード例では、新しフォーム画面中央作成しOpacity プロパティ設定してフォーム不透明度変更しますまた、既定サイズフォームより大きなフォーム作成するために、Size プロパティ設定します。このコード例は、この例で定義されているメソッド別のフォームからイベント ハンドラか他のメソッド呼び出されることを前提にしています。

Private Sub CreateMyOpaqueForm()
   ' Create a new form.
   Dim form2 As New Form()
   ' Set the text displayed in the caption.
   form2.Text = "My Form"
   ' Set the opacity to 75%.
   form2.Opacity = 0.75
   ' Size the form to be 300 pixels in height and width.
   form2.Size = New Size(300, 300)
   ' Display the form in the center of the screen.
   form2.StartPosition = FormStartPosition.CenterScreen

   ' Display the form as a modal dialog box.
   form2.ShowDialog()
End Sub
private void CreateMyOpaqueForm()
{
   // Create a new form.
   Form form2 = new Form();
   // Set the text displayed in the caption.
   form2.Text = "My Form";
   // Set the opacity to 75%.
   form2.Opacity = .75;
   // Size the form to be 300 pixels in height and width.
   form2.Size = new Size(300,300);
   // Display the form in the center of the screen.
   form2.StartPosition = FormStartPosition.CenterScreen;

   // Display the form as a modal dialog box.
   form2.ShowDialog();
}
private:
   void CreateMyOpaqueForm()
   {
      // Create a new form.
      Form^ form2 = gcnew Form;

      // Set the text displayed in the caption.
      form2->Text = "My Form";

      // Set the opacity to 75%.
      form2->Opacity = .75;

      // Size the form to be 300 pixels in height and width.
      form2->Size = System::Drawing::Size( 300, 300 );

      // Display the form in the center of the screen.
      form2->StartPosition = FormStartPosition::CenterScreen;

      // Display the form as a modal dialog box.
      form2->ShowDialog();
   }
private void CreateMyOpaqueForm()
{
    // Create a new form.
    Form form2 = new Form();

    // Set the text displayed in the caption.
    form2.set_Text("My Form");

    // Set the opacity to 75%.
    form2.set_Opacity(0.75);

    // Size the form to be 300 pixels in height and width.
    form2.set_Size(new Size(300, 300));

    // Display the form in the center of the screen.
    form2.set_StartPosition(FormStartPosition.CenterScreen);

    // Display the form as a modal dialog box.
    form2.ShowDialog();
} //CreateMyOpaqueForm
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS