OpenEdge GUI NET - "replace" for trigger

balta

Member
Hello,

in OE Classic, i do a lot of

Code:
apply "return": U to txtNumero

(txtNumero is a fill-in)

It is possible to do something similar in OE GUI .NET?

Thanks,
Baltazar
 

TomBascom

Curmudgeon
The line of code generating the error is cut in half - I can't really read it without a lot of guessing.

It would be much better to post a more complete example. Best of all would be two examples - one of the "classic" code that works as you would like, and the other with the error that is troubling you.
 

Osborne

Active Member
As Tom says, it is not easy to see from the code the actual problem.

Just to be clear, is txtNumero an ABL fill-in or a .NET fill-in? If .NET then that could be the reason for the error. Try something along these lines:
Code:
txtNumero:Focus().
System.Windows.Forms.SendKeys:Send("~{ENTER}").
This may not be the best soultion, but if it works then hopefully points you in the right direction.
 

balta

Member
In attach ABL "Classic" (OK) and ABL NET (NOK)
 

Attachments

  • teste_return_abl_classico.w
    6.4 KB · Views: 3
  • teste_return_abl_net.zip
    3.1 KB · Views: 2

Osborne

Active Member
In the okButton_Click method you are invoking an ABL event to a none ABL object which is not valid.

I do not know how to do the same for a .NET object. The only thing I can instantly think of is set a keypress event and method for txtNumero and adjust the button method to send a return to the relevant method:
Code:
METHOD PRIVATE VOID okButton_Click (sender AS System.Object, e AS System.EventArgs):
   DEFINE VARIABLE oKeyPressEventArgs AS System.Windows.Forms.KeyPressEventArgs NO-UNDO.

   oKeyPressEventArgs = NEW System.Windows.Forms.KeyPressEventArgs(System.Convert:ToChar(System.Windows.Forms.Keys:Return)).
   txtNumero_KeyPress(sender, oKeyPressEventArgs).
   // or txtNumero_KeyPress(?, oKeyPressEventArgs).
END METHOD.
 
Top