Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
Windows Forms
Closing one form when going to the next
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="mzim, post: 2641, member: 62"] try this one. set form2 as startup object. [code] Dim frm2 As Form2 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load frm2 = Me.Owner End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click frm2.flag = True Close() End Sub -------------------------------- Public flag As Boolean = False Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim frm1 As New Form1() Me.AddOwnedForm(frm1) frm1.ShowDialog() If flag = False Then Application.DoEvents() End If End Sub [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
Windows Forms
Closing one form when going to the next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom