| | |
Switching Between Forms
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 19
Reputation:
Solved Threads: 0
I want tu use more than one form in my project and be able to code a button or something that will do that. I tried this on Form1 and it worked.
BUT then I tried the following on Form2 to go back to Form1 and it doesn't work... the button does nothing.
Also, when the user switches to a different form, will the variables assigned on the first form still be assigned on the second form (assuming they're declared as Public in the module?
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Class Form1 Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 'Goes from this form to form 2 My.Forms.Form2.Show() End Sub End Class
BUT then I tried the following on Form2 to go back to Form1 and it doesn't work... the button does nothing.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click My.Forms.Form1.Show() 'Doesn't work End Sub End Class
Also, when the user switches to a different form, will the variables assigned on the first form still be assigned on the second form (assuming they're declared as Public in the module?
•
•
Join Date: Mar 2009
Posts: 916
Reputation:
Solved Threads: 167
0
#3 Oct 23rd, 2009
OldQ, for future reference you are using .NET code and are presently in the wrong forum. You need to post your Q's in the .NET forum...
In vb6 there are two different ways to accomplish what you want. One is setfocus and the other is zorder.
Good Luck
In vb6 there are two different ways to accomplish what you want. One is setfocus and the other is zorder.
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
![]() |
Similar Threads
- IIS .NET2 virtual directory not working (ASP.NET)
- User Controls as Forms within a Form (VB.NET)
- Changing/Switching to Forms Without Seeing the Desktop (VB.NET)
- Problem with 2 forms (C#)
- openin more forms C# (C#)
- Need Help! (Windows NT / 2000 / XP)
- switching between forms (PHP)
- How to free resources for other processes (VB.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: cd database
- Next Thread: Railway Reservation
Views: 352 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload label listbox listview liveperson login looping machine microsoft number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





