I am trying to copy some example code from c# for a .net component, and came across this line:
this.radPanel1.Paint += new PaintEventHandler(radPanel1_Paint);
I would translate this to be
THIS-OBJECT:radPanel1.Paint = new PaintEventHandler(radPanel1_Paint).
where "radPanel1_Paint" is a private method.
However, as soon as I add that line to the constructor, (after the initializeobjects) then OEA hangs and the JVM has to be terminated.
1) I presume that nothing should cause OEA to hang
2) does 10.2 support PaintEventHandler constructs ?
I am trying to copy some example code from c# for a
.net component, and came across this line:
this.radPanel1.Paint += new
PaintEventHandler(radPanel1_Paint);
I would translate this to be
THIS-OBJECT:radPanel1.Paint = new
PaintEventHandler(radPanel1_Paint).
where "radPanel1_Paint" is a private method.
Try:
this-object:radPanel1:Paint:Subscribe(radPanel1_Paint).
This construct should take care of all event handlers.
-- peter
thanks Peter, but it doesn't seem to run the method:
InitializeComponent ( ).
this-object:radPanel1:Paint:Subscribe(radPanel1_Paint).
METHOD PRIVATE void radPanel1_Paint(INPUT sender AS system.object, INPUT e AS PaintEventArgs):
DEF VAR a AS SolidBrush NO-UNDO.
DEF VAR b AS RectangleF NO-UNDO.
MESSAGE "here" VIEW-AS ALERT-BOX.
END METHOD.
thanks Peter, but it doesn't seem to run the method:
I've just tried this (with a SplitContainer's Panel, which is a Microsoft control) and I get messages from the event handler.
InitializeComponent ( ).
this-object:radPanel1:Paint:Subscribe(radPanel1_Paint)
.
I've tried both this and a 'normal' subscription in the InitComp() method, although not with Beta.
METHOD PRIVATE void radPanel1_Paint(INPUT sender AS
system.object, INPUT e AS PaintEventArgs):
DEF VAR a AS SolidBrush NO-UNDO.
DEF VAR b AS RectangleF NO-UNDO.
MESSAGE "here" VIEW-AS ALERT-BOX.
END METHOD.
-- peter
Solved it. There were two radPanel1_Paint methods defined:
radPanel1_Paint(INPUT sender AS system.object, INPUT e AS PaintEventArgs)
and
radPanel1_Paint(INPUT sender AS system.object, INPUT e AS System.EventArgs)
my code was in the PaintEventArgs version - the System.EventArgs version was empty. However, that was the one being run in preference to PaintEventArgs
Thanks for the help