ButtonBase.FlatStyle プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As ButtonBase Dim value As FlatStyle value = instance.FlatStyle instance.FlatStyle = value
[LocalizableAttribute(true)] public: property FlatStyle FlatStyle { FlatStyle get (); void set (FlatStyle value); }
/** @property */ public FlatStyle get_FlatStyle () /** @property */ public void set_FlatStyle (FlatStyle value)
FlatStyle 値の 1 つ。既定値は Standard です。


RadioButton クラスおよび CheckBox クラスの FlatStyle プロパティが System に設定されている場合、コントロールはユーザーのオペレーティング システムによって描画され、チェックの配置は CheckAlign プロパティ値と TextAlign プロパティ値に基づいて決定されます。CheckAlign プロパティ値は変わりませんが、コントロールの外観に影響を与えることがあります。チェック ボックスは、水平方向にはコントロールの左端または右端に寄せられ、左寄せまたは中央寄せの場合は左寄せになり、右寄せの場合は変わりません。垂直方向には、説明するテキストと同じように配置されます。たとえば、CheckBox コントロールの CheckAlign プロパティの値が ContentAlignment.MiddleCenter に設定されており、TextAlign プロパティの値が ContentAlignment.TopRight に設定されており、FlatStyle プロパティの値が System に設定されている場合、テキストの配置は変わりませんが、チェック ボックスの配置は ContentAlignment.TopLeft と同様になります。
![]() |
---|
FlatStyle プロパティが FlatStyle.System に設定されている場合、Image プロパティに割り当てられているイメージは表示されません。 |

派生クラス 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; }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からButtonBase.FlatStyle プロパティを検索する場合は、下記のリンクをクリックしてください。

- ButtonBase.FlatStyle プロパティのページへのリンク