Nice Ironpython code Lardmeister, thanks!
If you don't want the frills (color, button) you can really simplify the code using defaults ...
# add '99 bottles of beer' lyrics to a .NET list box
# simplified code using some defaults
# tested with IronPython 2.6 by vegaseat
import clr
clr.AddReference('System.Windows.Forms')
import System
from System.Windows.Forms import *
from System.Collections import ArrayList
class BeerSong(Form):
def __init__(self):
self.Text = '99 Bottles of Beer'
# create the listbox and fill the form (self) with it
box = ListBox()
box.Dock = DockStyle.Fill
self.Controls.Add(box)
# move the lyrics into ArrayList then transfer to the box
array = ArrayList()
bottle = "%s bottle"
beer = "s of beer on the wall!"
take = "Take one down, pass it around,"
for k in range(99, 0, -1):
# an exercise in slicing
s1 = bottle % k + beer[k==1:]
s2 = (bottle % k + beer[k==1:])[:-13] + "!"
s3 = bottle % (k-1 or "No")
s4 = beer[k==2:-1] + "!"
array.Add(s1)
array.Add(s2)
array.Add(take)
array.Add(s3+s4)
array.Add(" ")
box.DataSource = array
Application.Run(BeerSong())