VB2005 Hiding Windows Forms

G

Guest

I recently installed and started using VS2005 on a Windows XP Pro machine.
When creating a new windows forms project I find that I am unable to hide any
forms using the me.hide() or me.visible = False methods. As far as I can tell
these methods are available and should work in VB2005. Any help and advise
would be great as this is causing be a number of problems of two new
projects I am working on.

Many Thanks
 
P

pvdg42

Steve954 said:
I recently installed and started using VS2005 on a Windows XP Pro machine.
When creating a new windows forms project I find that I am unable to hide
any
forms using the me.hide() or me.visible = False methods. As far as I can
tell
these methods are available and should work in VB2005. Any help and advise
would be great as this is causing be a number of problems of two new
projects I am working on.

Many Thanks

<FormName>.Visible = False works fine here. VS .NET Pro 2005 on Win XP SP2.
Please provide a short, but complete example where it fails on your PC.
 
P

pvdg42

Steve954 said:
I recently installed and started using VS2005 on a Windows XP Pro machine.
When creating a new windows forms project I find that I am unable to hide
any
forms using the me.hide() or me.visible = False methods. As far as I can
tell
these methods are available and should work in VB2005. Any help and advise
would be great as this is causing be a number of problems of two new
projects I am working on.

Many Thanks

<FormName>.Visible = False works fine here, as does Me.Hide().
VS .NET Pro 2005 on Win XP SP2.
Please provide a short, but complete example where it fails on your PC.
 
G

gene kelley

I recently installed and started using VS2005 on a Windows XP Pro machine.
When creating a new windows forms project I find that I am unable to hide any
forms using the me.hide() or me.visible = False methods. As far as I can tell
these methods are available and should work in VB2005. Any help and advise
would be great as this is causing be a number of problems of two new
projects I am working on.

Many Thanks

Not working as in still visible, or, Closing rather than Hiding?
How and where are you using Hide?

Gene
 
T

Truong Hong Thi

It won't work if you call it in form's Load event.
Even if you call Close in form Load, the form might splash before
hiding.
Calling Dispose() does not splash.
 
G

Guest

Neither method works, it is as if they were not called, the form stays both
visible and fully usable.

I created a new project with a single form (with the defaullt name), tried
adding the me.hide() to the form load event but the form remains visible. I
tried replacing the me.hide() with the me.visible = False but still the same.
Thus the code could not be simpler.

Many Thanks
 
G

gene kelley

Neither method works, it is as if they were not called, the form stays both
visible and fully usable.

I created a new project with a single form (with the defaullt name), tried
adding the me.hide() to the form load event but the form remains visible. I
tried replacing the me.hide() with the me.visible = False but still the same.
Thus the code could not be simpler.

Many Thanks

Me.Hide has no meaning in a Load Event as the form does not become visible until the Load Event is
completed (nothing yet to hide). What you are seeing is simply the form loading and displaying as
normal.

Put a Button on that simple form example and add Me.Hide to the button click event.


Gene
 
G

Guest

Thanks your advise led me to look for a event that fires after the form load
has completed and subsequently found the Form_Shown event. I have used the
me.hide method in this and all now works as required.

Many Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top