1. 程式人生 > >Application.EnableVisualStyles方法

Application.EnableVisualStyles方法

package VStyles;
 
import System.*;
import System.Drawing.*;
import System.Windows.Forms.*;

public class Form1 extends System.Windows.Forms.Form
{
    private System.Windows.Forms.Button button1;

    /** @attribute STAThread()
     */
    public static void main(String[] args)
    {
        Application.EnableVisualStyles();
        Application.Run(new Form1());
    } //main

    public Form1()
    {
        this.button1 = new System.Windows.Forms.Button();
        this.button1.set_Location(new System.Drawing.Point(24, 16));
        this.button1.set_Size(new System.Drawing.Size(120, 100));
        this.button1.set_FlatStyle(FlatStyle.System);
        this.button1.set_Text("I am themed.");
        // Sets up how the form should be displayed and adds the controls 
        // to the form.
        this.set_ClientSize(new System.Drawing.Size(300, 286));
        this.get_Controls().Add(this.button1);

        this.set_Text("Application.EnableVisualStyles Example");
    } //Form1 
} //Form1