Font.Bold プロパティ
アセンブリ: System.Drawing (system.drawing.dll 内)


op_Inequality 演算子、Font コンストラクタ、および Bold プロパティを使用するコード例を次に示します。この例は、Button2 という名前のボタンを含んだ Windows フォームでの使用を意図してデザインされています。次のコードをフォームに貼り付け、Button2_Click メソッドをボタンの Click イベントに関連付けます。
Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click If (Color.op_Inequality(Me.BackColor, SystemColors.ControlDark)) Then Me.BackColor = SystemColors.ControlDark End If If Not (Me.Font.Bold) Then Me.Font = New Font(Me.Font, FontStyle.Bold) End If End Sub
private void Button2_Click(System.Object sender, System.EventArgs e) { if (this.BackColor != SystemColors.ControlDark) { this.BackColor = SystemColors.ControlDark; } if (!(this.Font.Bold)) { this.Font = new Font(this.Font, FontStyle.Bold); } }
void Button2_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ ) { if ( this->BackColor != SystemColors::ControlDark ) { this->BackColor = SystemColors::ControlDark; } if ( !(this->Font->Bold) ) { this->Font = gcnew System::Drawing::Font( this->Font,FontStyle::Bold ); } }
private void button2_Click(System.Object sender, System.EventArgs e) { if (!(this.get_BackColor().Equals(SystemColors.get_ControlDark()))) { this.set_BackColor(SystemColors.get_ControlDark()); } if (!(this.get_Font().get_Bold())) { this.set_Font(new Font(this.get_Font(), FontStyle.Bold)); } } //button2_Click

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Font.Bold プロパティのページへのリンク