Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy one about Me.Hide() 1

Status
Not open for further replies.

caoamo

Programmer
Oct 8, 2005
29
0
0
US
Excuse my ignorance, as I'm still fairly new to VB.NET....

I want to hide my start up form while the form gathers some data from the users computer.

Why won't this work for hiding the form when the application loads?

Code:
Private Sub frmResults_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

	Me.Hide()
End Sub
 
Hi:

First off, use Visible=False, and then you have to put it not only in the Form_Load, but in the Form_Activate. If you have other code to run, the Visible must be the first command in both Load and Activate or you'll get what I call a "Flickering" form--where you'll see it for a millisecond.

I hope this helps.



Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 

Thanks, have a star :)

One question...Why the preference of using Visible = False over Me.Hide()?

Is it a performance issue?
 
I think it's because Hide is considered VB6, although it is allowed in .Net.

I've just gotten used to Visible=True/False.

Thanks for the star.


Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top