使用下面的代码,调用第二个函数 (Checkbox1.CheckedChanged) 的最佳方法是什么?我尝试使用 (sender, e) 但每次程序完成安装时它都会连续调用 App2.msi,当它尝试重复安装 App2.msi 时将程序投入连续循环.. 在没有发件人的情况下尝试“调用 CheckBox1_CheckedChanged ()" 但我的代码将无法编译。
我对 VB 很陌生,所以我不确定我是否应该以不同的方式调用 msi,或者我只是不够了解如何调用这样的东西。如果有人需要更多详细信息,请告诉我!谢谢你!
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim p1 As New Process
p1 = System.Diagnostics.Process.Start("App1.msi")
p1.WaitForExit()
CheckBox2.Checked = True
Label2.Visible = True
Call CheckBox1_CheckedChanged()
End Sub
Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
End Sub
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
End Sub
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
Dim p1 As New Process
p1 = System.Diagnostics.Process.Start("App2.msi")
p1.WaitForExit()
CheckBox1.Checked = True
Label3.Visible = True
End Sub
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
End Sub
End Class