473,413 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

unload and show forms

hi
at visual basic 6
i write this

to the button1_cl1ck

unload form1
form2.show

then form2 shown and the form1 unload

and at form2 button
i write
unload form2
form1.show

but when i bigin to visual basic dot net i write these
codes but they are not working .
Jul 21 '05 #1
1 4176
Hi salo,
hi
at visual basic 6
i write this

to the button1_cl1ck

unload form1
form2.show

then form2 shown and the form1 unload

and at form2 button
i write
unload form2
form1.show

but when i bigin to visual basic dot net i write these
codes but they are not working .

Of course not - VB.NET is not VB6. It's a different type of programming, and
everybody who wants to move to VB.NET has to learn a lot of new things.
However, I'll try to help.

In case Form1 is the first form in your Application, it won't work anyway -
since this is the main form of the program, the program ends if the form is
closed. I'm not sure what you try to do, but if you want to show a form,
close it an show another one, that's possible:
==================

Dim frm1 as new Form1()
Dim frm2 as new Form2()

frm1.Show()

' Do Something

frm1.Close()
frm2.Show()

' Do Something

frm2.Close()

===================

Just in case you try to add a SplashScreen to your app, you need to go a
different way. In that case I suggest to add a Main()-Method to the project
and set the start-object to this main()-Method. Then you can add a
SplashScreen like this:

===================
public shared sub Main(args as String())

dim splashForm as new Form2() ' Form2 must be the SplashForm ...
dim mainForm as new Form1() ' this is the main form of your app
splashForm.Show()

' Do something

splashForm.Close()

Application.Run(mainForm)

End sub

===================

Regards,

--
Frank Eller [.NET MVP]
www.frankeller.de
..NET Developers Group Munich- www.munichdot.net
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Harry J. Smith | last post by:
I have written a Visual Basic program that does a long calculation and writes the results to disk as it runs. If I click the Close button the window closes but the program keeps running. How can I...
4
by: V.Boomessh | last post by:
Hai can any one help me on this problem. I am new to VB.NET. I have 2 forms. (form1 and form2) On click of a button in form1 i want to show form2 and unload form1
2
by: Lauren Hines | last post by:
Hello, I have read numerous post stating that the only way to unload an assembly (DLL in my case) is to create a separate AppDomain, load the assembly, then unload it by calling AppDomain.Unload....
4
by: Claudia Fong | last post by:
Hi, I have more than one forms in my program, and I would like to for example, in form1, I will call form2 and in form2 it will call form3. But the problem is when I call form2.Show, it does...
2
by: brianbender | last post by:
I am trying to load and unload assemblies dynamically and call methods and properties when loaded into an Appdomain I can load assemblies all day in the current AppDomain without references and...
4
by: Brett Baisley | last post by:
I am used to VB6 where frmMain.unload, frmNew.load worked. What replaced this in vb.net?
1
by: salo | last post by:
hi at visual basic 6 i write this to the button1_cl1ck unload form1 form2.show
3
lotus18
by: lotus18 | last post by:
How to cancel the unload event of a form? I have this code in vb 6 and it is working: Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If MsgBox("Are you sure you...
7
by: Shawn | last post by:
Have had a complete brain-fart and cannot think of how to stop code execution without unloading the form in vb.net. In other words, if my code catches an error, I want it to tell the user and stop...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.