![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2007
Posts: 2
Rep Power: 0
![]() |
Hi im relatively new to visual basic and i was wondering if anybody could help me. I'm trying to open a second form when i click a button on the first form, what is the code to do that. My programming teacher is to dumb and doesn't know how, so maybe you all could help. Thanks!
|
|
|
|
|
|
#2 |
|
Newbie
Join Date: Mar 2007
Location: at this heap offset AF3A: 66C3
Posts: 10
Rep Power: 0
![]() |
I'll help you!
Just drop VB and turn to C++. ![]() |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
Welcome to the Forums. Have you tried google-ing this? If not I suggest you do so. The next thing would be take up Jimmy's thought of learning C++. I will tell you this much. You create an object variable that references to the second form. So now you get to do some work and find out how to create a variable of an object of another form. It's quiet easy, I'll start it out for you: Dim mySecondForm as ___ _____ there you go, find out how to fill in those two blanks and you should be able to figure the rest out.
|
|
|
|
|
|
#4 |
|
Programmer
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0
![]() |
Hi,
I don't know Visual Basic but it's the same like in C#, so in C# I do something like shown below: CSharp Syntax (Toggle Plain Text)
and I converted the above code to VB.NET using developerfusion utility http://www.developerfusion.co.uk/uti...sharptovb.aspx to make the conversion and the VB code should look like below: vbnet Syntax (Toggle Plain Text)
As you can see I have commented .ShowDialog() method. With the .Show() method we can manipulate with two opened forms we can minimize Form1 work with Form2 or opposite, but when we use .ShowDialog() method, we cannot work in Form1 while the Form2 is shown, it is like a MessageBox we should close Form2 and continue working with Form1. But keep in mind, in our case here Form2 is child form of the Form1, so if you are using .Show dialog and if you close Form1 the Form2 will close. If you have further questions, or I didn't express so good, post a reply we hare here for this reason to help each other . |
|
|
|
|
|
#5 | |
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3
![]() |
this was posted in the VB category, so obviously they are looking for an vb solution, and they did hint that they are studying this, i wonder what their lecturer would think if they handed in c++ code for an vb assignment
anyways... i think you need to hide the current form and show the target form using the methods already provided by the forms: currentform.hide targetform.show
__________________
Quote:
|
|
|
|
|
|
|
#6 | |
|
Hobbyist Programmer
Join Date: Apr 2005
Posts: 218
Rep Power: 4
![]() |
Stop telling him to learn a new language, it has nothing to do with his question and is not appriciated.
Quote:
Private Sub Command1_Click() Form2.Show End Sub |
|
|
|
|
|
|
#7 |
|
Newbie
Join Date: Mar 2007
Posts: 2
Rep Power: 0
![]() |
Thanks alot everyone, well atleast everyone that helped me and didn't try to get me to learn C++. That's advanced programming in my school, and i'm not in that yet. Anyway thanks alot everyone you really helped!
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Form Link | tayspen | C# | 1 | Oct 26th, 2005 12:37 PM |
| Program compiling even without reference to required static link files | c0ldshadow | C++ | 9 | Sep 16th, 2005 5:11 PM |
| dynamically creating a link element | glevine | JavaScript and Client-Side Browser Scripting | 5 | Jul 14th, 2005 11:04 AM |
| Singly Linked List Help | Firebar | Java | 3 | May 22nd, 2005 10:56 AM |
| Getting parent forms object | Mark67 | Visual Basic | 2 | Jan 14th, 2005 10:38 PM |