简体   繁体   中英

Refresh an opened form vb.net

I have my form 1 and when I click in a button it opens my form 2. I want to introduce some information in this second form in order to uptade the first form. I tried this:

Public class Form2

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

    ... {some code here}

    Form1.Refresh()
    Me.Close()

    End Sub
End Class

But this isn't refreshing my form1. I know I can close the first form and open it again, but i don't pretend that. Is there any other way to do this?

Based on the input provided by you, you should fetch the data again from the database in the first form. The refresh method / event handler is different that the Form Load method. You need to call again the method / code responsible for fetching the data from the database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM