How To Win Forms
Print Hello World
Write Basic Syntax
Use Properties
Make An If Else Ladder
Make A Branch Statement
Declare Inits
Use Lists
Use Arrays
Make A Class Hierarchy
Use Nil And Nilable Types
Use Dynamic Typing
Declare Variable Number Of Args
Read And Write Files
Check Inheritance And Implementation
Customize Object Equality
Pass References To Methods
Translate Pseudo Code To Cobra 1
Translate Pseudo Code To Cobra 2
Implement IEnumerable 1
Implement IEnumerable 2
Iterate Through Recursive Data With Yield
Make A Collection Class
Declare Contracts
Win Forms
Access MySQL
Open TK
To compile:
cobra -c -t:winexe 380-WinForms.cobra

To run:

Or leave out the "-c" to compile and run in one shot.

Also, leave out -t:winexe and run from the command line to see the output of
`print` and `trace` statements.

Note that you don't have to explicitly reference the System.Windows.Forms.dll in
the command line because the `use` clause below will automatically locate it.

Recommended reading:

    Programming Microsoft Windows Forms
    by Charles Petzold

    Pro .NET 2.0 Windows Forms
    by Matthew MacDonald

Cobra tips:
    * Combine enums: AnchorStyle(Left, Right)
    * Hook up events: listen someObj.someEvent, ref .myMethod
    * In event handlers, leave out the type of the sender and you can use
      dynamic typing to easily access the senders properties and methods.

There is more substantial WinForms code in the source code for Cobra under

@args -t:winexe

use System.Windows.Forms

class MyForm inherits Form

    cue init
        .text = 'Sample Form'
        flp = FlowLayoutPanel(parent=this, dock=DockStyle.Fill, flowDirection=FlowDirection.TopDown)
        b = Button(parent=flp, autoSize=true, text='One', tag=1)
        listen, ref .handleClick
        b = Button(parent=flp, autoSize=true, text='Two', tag=2)
        listen, ref .handleClick

    def handleClick(sender, args as EventArgs), 'You clicked [sender.text]/[sender.tag]', 'Click')

class Program

    def main has STAThread