我正在研究 Infopath 和 VBA 并面临一个微不足道的问题。我曾尝试对此进行搜索并找到了一些示例,但无法正确理解它们(作为新手)。
如果有人能把我推向正确的方向,我将不胜感激。
我试图通过单击一个名为 MasterSumbit 的按钮来完成四个按钮(button1、2、3、4)的执行代码
我在 InternalStartup 部分加载了事件处理程序
Private Sub InternalStartup(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Startup
AddHandler DirectCast(EventManager.ControlEvents("Button1"), ButtonEvent).Clicked, AddressOf Button1_Clicked
AddHandler DirectCast(EventManager.ControlEvents("Button2"), ButtonEvent).Clicked, AddressOf Button2_Clicked
...and such for button 3 and 4
AddHandler DirectCast(EventManager.ControlEvents("MasterSubmit"), ButtonEvent).Clicked, AddressOf MasterSubmit_Clicked
End Sub
这是 MasterSubmit 按钮上单击事件的代码
Public Sub MasterSubmit_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
Button1_Clicked.click()
Button2_Clicked.click()
Button3_Clicked.click()
Button4_Clicked.click()
End Sub
我收到每个按钮的以下错误
Argument not specified for parameter 'e' of 'Public Sub Button1_Clicked(sender As Object, e As Microsoft.Office.InfoPath.ClickedEventArgs)'.
Argument not specified for parameter 'sender' of 'Public Sub Button1_Clicked(sender As Object, e As Microsoft.Office.InfoPath.ClickedEventArgs)'.
感谢期待