[IronPython] Subclassing a Control

Davy Mitchell daftspaniel at gmail.com
Wed Nov 29 21:43:54 CET 2006


Thanks - got it working. Put the code snippet on my blog.
http://www.latedecember.com/sites/personal/davy/

class TransLabel(Control):
    def __init__(self):
        pass

    def CreateParams(self):
        cp = Label().CreateParams
        cp.ExStyle = cp.ExStyle | 0x20
        return cp
    CreateParams = property(fget=CreateParams)

    def OnPaintBackground(self,e):
        pass

    def OnPaint(self,e):
        grfx = e.Graphics
        grfx.DrawString("Hello World", self.Font, Brushes.Black, 0, 0)

Cheers,
Davy Mitchell

Blog - http://www.latedecember.com/sites/personal/davy/
Mood News
 - BBC News Headlines Auto-Classified as   Good,   Bad or   Neutral.
 http://www.latedecember.com/sites/moodnews/



More information about the Ironpython-users mailing list