Python on the third day.

xiaoxiao2021-03-06  177

import CLR.System.Windows.Forms as WinFormsfrom CLR.System.Drawing import Sizefrom CLR.System.Drawing import Pointfrom CLR.System.Drawing import Colorfrom 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_aftelect 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_aftelect (this, sender, args):

this.button.text = args.node.text

# Stdthreadwinforms.application.run (macroapp ())

转载请注明原文地址:https://www.9cbs.com/read-128264.html

New Post(0)