
Untitled
By: a guest on
Aug 5th, 2012 | syntax:
None | size: 0.52 KB | hits: 5 | expires: Never
How does one overide the OnShown Event of a form when creating a form programatically
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As Form1 = New Form1()
AddHandler f.Shown, AddressOf f_Shown
f.Show()
End Sub
Private Sub f_Shown(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Public Sub form_Showing(ByVal sender As Object, e As EventArgs)
// play sound
End Sub
Dim f As New Form
AddHandler f.Shown, AddressOf form_Showing
f.Show()