Question override OnPaint method (Net GUI)

Hello,
I am trying to override the OnPaint method in my inherited textbox so i can change the textcolor when the textbox is disabled (afaik thats the only way to do this)

the problem is that the text gets painted white when the textbox has no focus and when it gets focus it draws it in some default font and black...

here is my code:

Code:
CONSTRUCTOR PUBLIC myTextBox (  ):     
      SUPER().
      THIS-OBJECT:SetStyle(System.Windows.Forms.ControlStyles:UserPaint,TRUE).       
      InitializeComponent().
 
....

Code:
  METHOD PROTECTED OVERRIDE VOID OnPaint(INPUT e AS System.Windows.Forms.PaintEventArgs):
      SUPER:OnPaint(e).
     
      IF THIS-OBJECT:ENABLED = FALSE THEN DO:     
        DEFINE VARIABLE oDrawBrush AS System.Drawing.SolidBrush NO-UNDO.
        oDrawBrush = NEW System.Drawing.SolidBrush(THIS-OBJECT:ForeColor).
        e:Graphics:DrawString(THIS-OBJECT:TEXT,THIS-OBJECT:Font,oDrawBrush,0,0).
      END.
         
  END METHOD.


can anyone help me with this?


I am using Progress 10.2b sp 6
 
Top