VB restart form
I created a button and I need it to restart the form I have no idea how to work on the visual basic what should i write
Private Sub Button2_开发者_JAVA百科Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End Sub
Do you mean Application.Restart()
?
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Application.Restart()
End Sub
Although in Visual Basic this does the same as in C#, it restarts the application not just clears the form.
In order to reload the form you simply need to do this in the form's Load event.
Me.Close()
Me.Show()
Try This..
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Application.Restart()
End Sub
精彩评论