2012年5月26日 星期六

reloading Form


Dim es As System.EventArgs
    Dim sndr As System.Object
    Private Sub ResetThings()
        Try

            Dim c As Form.ControlCollection = Me.Controls
            'c= me.co
            Dim i As Integer = c.Count
            'Dim cnt As Integer = c.Count
            While i <> 0
                c.Item(0).Dispose()
                i -= 1
            End While


            Me.InitializeComponent()
            'Ur Form Name in place of frmDailySales_Load(sndr,es)
            Me.frmDailySales_Load(sndr, es)
        Catch ex As Exception
            MsgBox(ex.ToString())
            'Exit Sub
        End Try
End Sub

 Private Sub frmDailySales_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
     
            MsgBox("Load Called")

End Sub

沒有留言:

張貼留言