-1
In VBA at the event Teclapressionada would be this way. Thanks to v/ help to convert to C#.
Private Sub EditorVendas_TeclaPressionada(KeyCode As Integer, Shift As Integer)
Dim i As Long
Dim CaractsArtigoPT As StdBECampos
Dim objLinha As GcpBELinhaDocumentoVenda
i = Me.DocumentoVenda.Linhas.NumItens
If KeyCode = KeyCodeConstants.vbKeyY And Shift = 2 Then
Set CaractsArtigoPT = BSO.Comercial.ArtigosIdiomas.DaValorAtributos(Me.DocumentoVenda.Linhas(i).Artigo, "PT", "Caracteristicas")
If Not CaractsArtigoPT Is Nothing Then
If CaractsArtigoPT.NumItens > 0 Then
Set objLinha = New GcpBELinhaDocumentoVenda
objLinha.TipoLinha = 60
objLinha.Descricao = "" & CaractsArtigoPT("Caracteristicas")
Me.DocumentoVenda.Linhas.Insere objLinha
End If
End If
Set CaractsArtigoPT = Nothing
End If
End Sub
Unless you want to take advantage of some specific functionality that only exists in C#, the easiest is to migrate from Vba to VB.net. Then it is easier to switch to C# because there are several online converters.
– Sérgio Sereno