?
Solved

Me.Visible = False not working

Posted on 2006-07-07
12
Medium Priority
?
611 Views
Last Modified: 2011-10-03
I have a main form in my app with the following code at the start of its Load event:

Me.Visible = False
Dim frmSplash As New frmSplash
frmSplash.Show()

The idea is that this will render my main form invisible then open my splash screen form. The splash screen form then opens a network connection using its Load event and then sets the main form as visible again and closes itself.

The only problem is that the main form won't set itself as invisible for long. It appears as invisible then the splash screen form opens and the main form makes itself visible again even if I dont included the code in the splash screen form to make it visible again.

Can anyone let me know why its doing this and how I can sort it out?

Many Thanks.
0
Comment
Question by:kiranboi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +3
12 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17059498
Does the splash screen reference the main form anywhere?

Bob
0
 
LVL 9

Expert Comment

by:william007
ID: 17059542
You can put it at the activated event
    Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
        Me.Visible = False
        Dim frmSplash As New frmSplash
        frmSplash.Show()
    End Sub
Alternatively, you can just set the startup form as frmSplash.
0
 

Author Comment

by:kiranboi
ID: 17059551
No
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 17059583
1) Is there anything kind of special Paint handling for the main form

2) What kind of controls are on the main form?

3) .NET version?  2002, 2003 or 2005?

Bob
0
 

Author Comment

by:kiranboi
ID: 17059610
nope, no special paint handling.

there's main menus, listviews, toolbars and panels on the main form

its .net version 2003
0
 
LVL 35

Expert Comment

by:YZlat
ID: 17059644
try

Me.Hide
0
 

Author Comment

by:kiranboi
ID: 17059677
that gives me the same problem
0
 
LVL 35

Expert Comment

by:YZlat
ID: 17059989
I suggest you use GotFocus event instead of Activated. Activated event is kinda dangerous
0
 
LVL 9

Expert Comment

by:william007
ID: 17060156
>>Activated event is kinda dangerous
What is the reason?
0
 
LVL 3

Expert Comment

by:maidinhtai
ID: 17062603
Because you are using .NET 2003, so have a look here:
http://msdn2.microsoft.com/en-us/library/754w18dd.aspx
It will be simpler with the form.Shown event if you use .NET 2005.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17064988
I am thinking that some underlying, unseen code from one of the controls is showing the form again, and pulling it on top.  The form has a VisibleChanged event, which you can define, and put a breakpoint into to see what is causing the form to become visible.

Bob
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1500 total points
ID: 17068558
You can't hide the form from the Load event...   (it just doesn't work...dont' ask)

Either...

(1) Use a Sub Main() and show your splash form from there before showing your main form

(2) or use a Timer (with a short interval) in your main form and in the tick event make your form invisible from there.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question