473,379 Members | 1,355 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,379 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 4173
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.