Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Me.Visible = False not working

Posted on 2006-07-07
12
Medium Priority
?
616 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
Industry Leaders: 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!

 
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

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.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 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