import System
import System.Drawing
import System.Windows.Forms
class Frame(Form):
def constructor(str as String):
self.Text = str
#standerd method
ba = Button(Text: "OK")
ba.Click += ba_Click
#anonymous method
bc = Button(Text: "Cancel")
bc.Click += def(sender as Object, e as EventArgs):
print "anonymous", sender, e
bc.Bounds = Rectangle(0, 25, 75, 24)
self.Controls.Add(ba)
self.Controls.Add(bc)
def ba_Click(sender as Object, e as EventArgs):
print "click...", sender, e
[STAThread]
def Main():
f = Frame("WinForms")
Application.Run(f)
