reloading Form

i want to reload my already opened form ...
is there any method
or can i call any event through my code
like i may call the load event from any Function......


  • Is it the main form? What are you trying to "reload"? Do you need a new instance for all the components, or can you reuse the ones there? You could try calling the '.Dispose' on the componets object for the form... then calling the 'InitializeComponent()' I have not done this in theory it sounds good:)

    If it is just control settings and databinding etc.... I often do something like so ...

    private sub Load(blah blah) handles mybase.load
    end sub

    private sub Reload()
    end sub

    Private Sub LoadForm()
    'lock any control you need to

    'bind anything you need

    'set control state based of binding if needed

    'Other processing

    End Sub

  • i also use the second method but the first method ie
    doesnt works
    cuz on dispose method it distroys it self

  • compoents.Dispose

    me.dispose wil get rid of whole form.
  • [b][red]This message was edited by aamirwazir at 2005-11-23 11:52:21[/red][/b][hr]
    here is wat i did
    Dim es As System.EventArgs
    Dim sndr As System.Object
    Private Sub ResetThings()

    Dim c As Form.ControlCollection = Me.Controls
    Dim i As Integer = c.Count
    'Dim cnt As Integer = c.Count
    While i <> 0
    i -= 1
    End While

    'Ur Form Name in place of frmDailySales_Load(sndr,es)
    Me.frmDailySales_Load(sndr, es)
    Catch ex As Exception
    '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

    You Will Get same Mewssage Box Which U Had got at the time of Load :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!