下载安装SharpDevelop,下载地址:http://www.icsharpcode.net/OpenSource/SD/Download/Default.aspx#SharpDevelop3x
建议下载4.4版本
启动SharpDevelop
新建项目
完整代码如下:
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
import System.Drawing
import System.Windows.Forms
from System.Drawing import *
from System.Windows.Forms import *
class MainForm(Form):
def __init__(self):
self.InitializeComponent()
def InitializeComponent(self):
self._label1 = System.Windows.Forms.Label()
self.SuspendLayout()
#
# label1
#
self._label1.Font = System.Drawing.Font("ËÎÌå", 36, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134)
self._label1.Location = System.Drawing.Point(12, 23)
self._label1.Name = "label1"
self._label1.Size = System.Drawing.Size(550, 69)
self._label1.TabIndex = 0
self._label1.Text = "ÎÒÊÇSpaceClaimµÄµ¯´°"
self._label1.Click += self.Label1Click
#
# MainForm
#
self.ClientSize = System.Drawing.Size(533, 93)
self.Controls.Add(self._label1)
self.Name = "MainForm"
self.Text = "SpaceClaim"
self.ResumeLayout(False)
def Label1Click(self, sender, e):
pass
SpaceClaim=MainForm()
SpaceClaim.ShowDialog()
启动SpaceClaim
新建一个脚本
将刚才在SharpDevelop当中完成的代码复制到SpaceClaim的代码编辑器中,然后运行