AddHandler_Load in VB.Net language
Emanuele Croci
Dear all,how can I translate this C# source code into VB.Net?
[font=comic sans ms,cursive]public void Run()
{
Form.AddHandler_Load("133", ModeComponent.FormModes.ALL, ARInvoice_Loaded);
}[/font]
[font=comic sans ms,cursive] private void ARInvoice_Loaded(FormLoad e)
{
e.Form.Select();
Button btn = (Button)e.Form.Items["1"];
// ....
}[/font]
I tryed in this way....
[font=comic sans ms,cursive]Public Sub Run() Implements coresuiteFramework.Loader.Module.IModule.Run
Try
SwissAddonFramework.UI.Components.Form.AddHandler_Load("133", _
ModeComponent.FormModes.ALL, _
ARInvoice_Loaded)
Catch ex As Exception
End Try
End Sub[/font]
[font=comic sans ms,cursive]Private Sub ARInvoice_Loaded(ByRef e As SwissAddonFramework.UI.EventHandling.ItemEvents.FormLoad)
Try
Dim btn As Button
e.Form.Select()
btn = e.Form.Items("1")
' ....
Catch ex As Exception
End Try
End Sub[/font]
... but I have a compilation error:
Argument not specified for parameter 'e' of 'Private Sub ARInvoice_Loaded(ByRef e As SwissAddonFramework.UI.EventHandling.ItemEvents.FormLoad)
Please, can someone help me?
Best regards
Emanuele
Emanuele Croci
I found a solution:...
[font=comic sans ms,cursive]Public Sub Run() Implements coresuiteFramework.Loader.Module.IModule.Run[/font]
[font=comic sans ms,cursive] SBO_Application = SwissAddonFramework.B1Connector.GetB1Connector().Application[/font]
[font=comic sans ms,cursive] AddHandler SBO_Application.ItemEvent, AddressOf SBO_Application_ItemEvent[/font]
[font=comic sans ms,cursive] ...[/font]
[font=comic sans ms,cursive]End Sub[/font]
[font=comic sans ms,cursive]Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, _[/font]
[font=comic sans ms,cursive] ByRef pVal As SAPbouiCOM.ItemEvent, _[/font]
[font=comic sans ms,cursive] ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent[/font]
[font=comic sans ms,cursive]If (pVal.FormType = 133) Then[/font]
[font=comic sans ms,cursive]....[/font]
[font=comic sans ms,cursive]End If[/font]
[font=comic sans ms,cursive] ....[/font]
[font=comic sans ms,cursive]End Sub[/font]
Best regards
Emanuele
0
Please sign in to leave a comment.
Comments
0 comments