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

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

ButtonBase.ImageAlign プロパティ

ボタン コントロール上のイメージ配置取得または設定します

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

<LocalizableAttribute(True)> _
Public Property ImageAlign As
 ContentAlignment
Dim instance As ButtonBase
Dim value As ContentAlignment

value = instance.ImageAlign

instance.ImageAlign = value
[LocalizableAttribute(true)] 
public ContentAlignment ImageAlign { get; set;
 }
[LocalizableAttribute(true)] 
public:
property ContentAlignment ImageAlign {
    ContentAlignment get ();
    void set (ContentAlignment value);
}
/** @property */
public ContentAlignment get_ImageAlign ()

/** @property */
public void set_ImageAlign (ContentAlignment
 value)
public function get ImageAlign
 () : ContentAlignment

public function set ImageAlign
 (value : ContentAlignment)

プロパティ
ContentAlignment 値の 1 つ既定値MiddleCenter です。

例外例外
例外種類条件

InvalidEnumArgumentException

代入された値が、ContentAlignment 値ではありません。

使用例使用例

派生クラス Button使用して、その共通プロパティ一部設定するコード例次に示します結果としてテキスト左側イメージ右側に含むフラットなボタン表示されます。このコードでは、C:\Graphics ディレクトリMyBitMap.bmp という名前のビットマップ イメージ格納されており、System.Drawing 名前空間への参照コード含まれている必要があります

Private Sub SetMyButtonProperties()
    ' Assign an image to the button.
    button1.Image = Image.FromFile("C:\Graphics\MyBitmap.bmp")
    ' Align the image and text on the button.
    button1.ImageAlign = ContentAlignment.MiddleRight
    button1.TextAlign = ContentAlignment.MiddleLeft
    ' Give the button a flat appearance.
    button1.FlatStyle = FlatStyle.Flat
End Sub 'SetMyButtonProperties
private void SetMyButtonProperties()
 {
    // Assign an image to the button.
    button1.Image = Image.FromFile("C:\\Graphics\\MyBitmap.bmp");
    // Align the image and text on the button.
    button1.ImageAlign = ContentAlignment.MiddleRight;    
    button1.TextAlign = ContentAlignment.MiddleLeft;
    // Give the button a flat appearance.
    button1.FlatStyle = FlatStyle.Flat;
 }
 
private:
   void SetMyButtonProperties()
   {
      // Assign an image to the button.
      button1->Image = Image::FromFile( "C:\\Graphics\\MyBitmap.bmp"
 );
      // Align the image and text on the button.
      button1->ImageAlign = ContentAlignment::MiddleRight;
      button1->TextAlign = ContentAlignment::MiddleLeft;
      // Give the button a flat appearance.
      button1->FlatStyle = FlatStyle::Flat;
   }
private void SetMyButtonProperties()
{
    // Assign an image to the button.
    button1.set_Image(Image.FromFile("C:\\Graphics\\MyBitmap.bmp"));

    // Align the image and text on the button.
    button1.set_ImageAlign(ContentAlignment.MiddleRight);
    button1.set_TextAlign(ContentAlignment.MiddleLeft);

    // Give the button a flat appearance.
    button1.set_FlatStyle(FlatStyle.Flat);
} //SetMyButtonProperties
private function SetMyButtonProperties()
 {
    // Assign an image to the button.
    button1.Image = Image.FromFile("C:\\Graphics\\MyBitmap.bmp");
    // Align the image and text on the button.
    button1.ImageAlign = ContentAlignment.MiddleRight;    
    button1.TextAlign = ContentAlignment.MiddleLeft;
    // Give the button a flat appearance.
    button1.FlatStyle = FlatStyle.Flat;
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からButtonBase.ImageAlign プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からButtonBase.ImageAlign プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からButtonBase.ImageAlign プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

「ButtonBase.ImageAlign プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS