ControlPaint.DrawButton メソッド (Graphics, Int32, Int32, Int32, Int32, ButtonState)
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Shared Sub DrawButton ( _ graphics As Graphics, _ x As Integer, _ y As Integer, _ width As Integer, _ height As Integer, _ state As ButtonState _ )
Dim graphics As Graphics Dim x As Integer Dim y As Integer Dim width As Integer Dim height As Integer Dim state As ButtonState ControlPaint.DrawButton(graphics, x, y, width, height, state)
public static void DrawButton ( Graphics graphics, int x, int y, int width, int height, ButtonState state )
public: static void DrawButton ( Graphics^ graphics, int x, int y, int width, int height, ButtonState state )
public static void DrawButton ( Graphics graphics, int x, int y, int width, int height, ButtonState state )
public static function DrawButton ( graphics : Graphics, x : int, y : int, width : int, height : int, state : ButtonState )

Imports System Imports System.Drawing Imports System.Windows.Forms Public Class Form1 Inherits System.Windows.Forms.Form Private button1 As System.Windows.Forms.Button = New Button Private button2 As System.Windows.Forms.Button = New Button <System.STAThreadAttribute()> _ Public Shared Sub Main() System.Windows.Forms.Application.Run(New Form1) End Sub Public Sub New() Me.button2.Location = New Point(0, button1.Height + 10) AddHandler Me.button2.Click, AddressOf Me.button2_Click Me.Controls.Add(Me.button1) Me.Controls.Add(Me.button2) End Sub Private Sub button2_Click(sender As Object, e As System.EventArgs) ' Draws a flat button on button1. ControlPaint.DrawButton(System.Drawing.Graphics.FromHwnd(button1.Handle), 0, 0, button1.Width, button1.Height, ButtonState.Flat) End Sub 'button2_Click End Class
using System; using System.Drawing; using System.Windows.Forms; public class Form1 : Form { private Button button1 = new Button(); private Button button2 = new Button(); [STAThread] static void Main() { Application.Run(new Form1()); } public Form1(){ this.button2.Location = new Point(0, button1.Height + 10); this.Click += new EventHandler(this.button2_Click); this.Controls.Add(this.button1); this.Controls.Add(this.button2); } private void button2_Click(object sender, System.EventArgs e) { // Draws a flat button on button1. ControlPaint.DrawButton( System.Drawing.Graphics.FromHwnd(button1.Handle),0,0,button1.Width,button1.Height , ButtonState.Flat); } }
#using <System.dll> #using <System.Drawing.dll> #using <System.Windows.Forms.dll> using namespace System; using namespace System::Drawing; using namespace System::Windows::Forms; public ref class Form1: public Form { private: Button^ button1; Button^ button2; public: Form1() { button1 = gcnew Button; button2 = gcnew Button; this->button2->Location = Point(0,button1->Height + 10); this->Click += gcnew EventHandler( this, &Form1::button2_Click ); this->Controls->Add( this->button1 ); this->Controls->Add( this->button2 ); } private: void button2_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ ) { // Draws a flat button on button1. ControlPaint::DrawButton( System::Drawing::Graphics::FromHwnd( button1->Handle ), 0, 0, button1->Width, button1->Height, ButtonState::Flat ); } }; [STAThread] void main() { Application::Run( gcnew Form1 ); }
import System.*; import System.Drawing.*; import System.Windows.Forms.*; public class Form1 extends Form { private Button button1 = new Button(); private Button button2 = new Button(); /** @attribute STAThread() */ public static void main(String[] args) { Application.Run(new Form1()); } //main public Form1() { this.button2.set_Location(new Point(0, button1.get_Height() + 10)); this.add_Click(new EventHandler(this.button2_Click)); this.get_Controls().Add(this.button1); this.get_Controls().Add(this.button2); } //Form1 private void button2_Click(Object sender, System.EventArgs e) { // Draws a flat button on button1. ControlPaint.DrawButton(System.Drawing.Graphics.FromHwnd( button1.get_Handle()), 0, 0, button1.get_Width(), button1.get_Height(), ButtonState.Flat); } //button2_Click } //Form1

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


ControlPaint.DrawButton メソッド

名前 | 説明 |
---|---|
ControlPaint.DrawButton (Graphics, Rectangle, ButtonState) | ボタン コントロールを、指定した状態で、指定したグラフィックスの表面の指定した範囲内に描画します。 |
ControlPaint.DrawButton (Graphics, Int32, Int32, Int32, Int32, ButtonState) | ボタン コントロールを、指定した状態で、指定したグラフィックスの表面の指定した範囲内に描画します。 |

ControlPaint.DrawButton メソッド (Graphics, Rectangle, ButtonState)
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Shared Sub DrawButton ( _ graphics As Graphics, _ rectangle As Rectangle, _ state As ButtonState _ )
Dim graphics As Graphics Dim rectangle As Rectangle Dim state As ButtonState ControlPaint.DrawButton(graphics, rectangle, state)
public static function DrawButton ( graphics : Graphics, rectangle : Rectangle, state : ButtonState )

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


- ControlPaint.DrawButtonのページへのリンク