[IronPython] Subclassing a Control

Davy Mitchell daftspaniel at gmail.com
Mon Nov 27 23:11:24 CET 2006


Hi Folks,

I was doing some IronPython for the first time in ages so forgive me
if I am being dumb :-)

Anyway I am trying to make a transparent label WinForm control:

class TransLabel(Label):

    def CreateParams(self):
        cp = super(TransLabel,self).CreateParams
        cp.ExStyle = cp.ExStyle | 0x20
        return cp

    def OnPaintBackground(self,e):
        pass

The problem is the super call fails with:
Traceback (most recent call last):
  File K:\MyDev\PyLP\helloWorld1.py, line 69, in Initialize
  File K:\MyDev\PyLP\helloWorld1.py, line 22, in __init__
  File , line 0, in DefaultNew##12
  File , line 0, in .ctor##26
  File System.Windows.Forms, line unknown, in .ctor
  File System.Windows.Forms, line unknown, in .ctor
TypeError: issubclass: arg 1 must be a class

line22 is only self.label = TransLabel()

Thanks and take care,
Davy Mitchell

-- 
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