Python第三天。

import CLR.System.Windows.Forms as WinForms
from CLR.System.Drawing import Size
from CLR.System.Drawing import Point
from CLR.System.Drawing import Color
from CLR.System.Drawing import SystemColors


class MacroApp(WinForms.Form):

    def __init__(this):

        this.Text                        = "Hello World"
        this.BackColor                   = Color.LightGray
        this.ClientSize                  = Size(450, 220)
        this.FormBorderStyle             = WinForms.FormBorderStyle.None
        this.Opacity                     = 0.8
        this.ShowInTaskbar               = 0
        this.TopMost                     = 1

        this.button                      = WinForms.Button()
        this.button.FlatStyle            = 1
        this.button.Dock                 = 2
        this.button.Text                 = "Alert Text"
       

        this.treeview                    = WinForms.TreeView()
        this.treeview.BorderStyle        = 2
        this.treeview.Dock               = 5

        this.button.Click                += this.button_Click
        this.treeview.AfterSelect        += this.treeView_AfterSelect
        this.Load                        += this.MacroApp_Load

        this.Controls.Add(this.button)
        this.Controls.Add(this.treeview)

    def button_Click(this, sender, args):

        WinForms.MessageBox.Show(this, this.button.Text, this.button.Text, 4)

    def MacroApp_Load(this, sender, args):

        this.treeview.Nodes.Add("Java")
        this.treeview.Nodes[0].Nodes.Add("Struts")
        this.treeview.Nodes[0].Nodes.Add("Spring")
        this.treeview.Nodes[0].Nodes.Add("Hibernate")
        this.treeview.Nodes[0].Nodes.Add("Poolman")
        this.treeview.Nodes.Add("C#")
        this.treeview.Nodes[1].Nodes.Add("ADO.NET")
        this.treeview.Nodes[1].Nodes.Add("ASP.NET")
        this.treeview.Nodes[1].Nodes.Add("JScript.NET")
        this.treeview.Nodes.Add("Python")

    def treeView_AfterSelect(this, sender, args):

        this.button.Text = args.Node.Text
       


#StdThread
WinForms.Application.Run(MacroApp())

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值