Link to home
Start Free TrialLog in
Avatar of Ahmadal_najjar2003
Ahmadal_najjar2003Flag for Kuwait

asked on

Can I Close The Current Form and Open in it again

Can I close the Form , the Open it again automatically
Avatar of Jeff Certain
Jeff Certain
Flag of United States of America image

The form, or the whole application?
SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ahmadal_najjar2003

ASKER

Just the Form which I'm Using .
BillMaster.VB
The Goal is , to refresh all text , Comboboxes ,, so on. As I loaded for first time.
Why dont you create some Reset() procedure that will set all controls to default values?

Goran
Thats Right , I always do that. But I wish to find another easy way. Otherwise I will use Old way.
Try this:
<asp:Button Text="Reset Form" id="btnReset" runat="server" />


In your code behind page write this:

Private Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click
Me.Server.Transfer("myPage.aspx")
End Sub
Sorry , I'm working with WIndows Application
There isnt any other way.

Goran
Other than this:

    Dim bm As New BillMaster
    bm.Show()
    Me.Close()

There isn't any other way to do it...
Even if it's possibl,e is not nice to do it because it takes more time then a refresh (it as to dispose the form and load it) and  it's not nice to the user (that see the flash closing and openning).
like this it works

Dim bm As New BillMaster
        Me.Close()
        bm.ShowDialog()

it seems as you open new bill , as manual do.
What version VB you using?
vb 2008
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I also want to thank jpaulino because he give me new info (Application.Restart())