473,387 Members | 1,650 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,387 software developers and data experts.

How do I show a form?

Why won't this work?

Dim frm As New Form1()

Me.Close()

frm.Show()

HELP!
Nov 21 '05 #1
6 1602
Daniel,

Are you using the IDE from VBNet to create a program.

The code that you are using now is.

Dim frm As New Form1() Create an extra form opbject and name it frm
Me.Close() Close this class and when that is the main class the program
frm.Show()

There is nothing more to show.

I hope this gives an idea, however first answer the first question.

When you use the IDE you have nothing to do and when you than click on debug
it will show a form.

Cor
Nov 21 '05 #2
"Daniel Kaseman" <da*@cfaith.com> schrieb:
Why won't this work?

Dim frm As New Form1()

Me.Close()

frm.Show()


Maybe your application is lacking a message pump after closing the form.

<URL:http://www.google.de/groups?selm=O%23xf7DwNFHA.2580%40TK2MSFTNGP09.phx. gbl>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
I'm trying to display a stratup screen, and then after 5 seconds, unload the
startup screen from memory, then show the main form.

It just flashes the main form for a fraction of a second, then when the
splash screen closes (me.close) the program closes. It should load the main
screen.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:e4**************@TK2MSFTNGP10.phx.gbl...
Daniel,

Are you using the IDE from VBNet to create a program.

The code that you are using now is.

Dim frm As New Form1() Create an extra form opbject and name it frm

Me.Close()

Close this class and when that is the main class the program

frm.Show()

There is nothing more to show.

I hope this gives an idea, however first answer the first question.

When you use the IDE you have nothing to do and when you than click on

debug it will show a form.

Cor

Nov 21 '05 #4
Daniel,

In your mainform
\\\
dim frm as new formSplash
frm.showsplash
'formSplasy has by instance a form timer
'and when those event fires (tick) in that me.close
frm.dispose
///

That is in my opinion the most simple one.

I hope this helps,

Cor

Nov 21 '05 #5
Daniel, you should do it like this (probably the best way for splashing a
form):

1- Use a separate module for starting your application like this :

Public Module Entery
Public Sub Main()
Dim frm1 As New SplashForm
frm1.Show()
Threading.Thread.Sleep(5000)
frm1.Close()
Application.Run(New Form1)
End Sub
End Module

2- And "SplashForm" is the form you want to splash before the main form (
Form1).

3- Don't forget to set the project start up object to "Sub Main".

-----
hope this help
"Daniel Kaseman" <da*@cfaith.com> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
I'm trying to display a stratup screen, and then after 5 seconds, unload
the
startup screen from memory, then show the main form.

It just flashes the main form for a fraction of a second, then when the
splash screen closes (me.close) the program closes. It should load the
main
screen.


Nov 21 '05 #6
For better results, use the following module ( Application.DoEvents Is
added):

Public Module Entery
Public Sub Main()
Dim frm1 As New SplashForm
frm1.Show()
Application.DoEvents()
Threading.Thread.Sleep(5000)
frm1.Close()
Application.Run(New Form1)
End Sub
End Module
Nov 21 '05 #7

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

Similar topics

3
by: dp | last post by:
I am new to VB.NET and I have a simple question. How do I show a form from a command button click event? The code I have below is not working. I am trying to show the form frmAgent. What am I...
13
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide...
2
by: Ajai Kumar .R | last post by:
Hai all, I've two or more forms on my app. My requirement is, Have to show the first form asa the user press a button have to hide the first form and show the second form. If the user press the...
20
by: WindAndWaves | last post by:
Hi Gurus I was wondering if you can send me in the right direction: I have a table with about 300 rows. I want to make all of them invisible and when a user enters a code in a form then make...
1
by: cefrancke | last post by:
I have set the Startup properties to the following... All menus, toolbars, etc are turned off plus these are unchecked Allow Full Menus Allow Built-in Toolbars Allow Default Shortcut Menus...
0
by: Homa | last post by:
Hi I'm working on a program that will have 3 forms: a main form, a status form and a sub-form. The main form and status form are always appear, and my sub-form is a singleton (for performance...
13
by: Tim Smallwood | last post by:
Hi, This is probably a stupid question, but I can't seem to get a form to show / load? In the older versions of VB I'd use frmMyform.show / load myForm, etc? I looked at the help file and it...
3
by: yzi | last post by:
I have a list form and a detail form . Before, I open the List form, use form.showDialog(),then I click List Item and open the Detail Form by form.show(). now , user need when the list form...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
4
by: Delphiscn | last post by:
How to show a ABOUT Form???????? Hello Everyone: I use C# want to Create a Project. In my project. there are two forms. One is main form, and another is a about form. In the about form there...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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,...

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.