VB2005 express: When program is started, form is visible.

Posted on 2007-08-09
Last Modified: 2013-11-27
OK, I really become frustrated with this VB 2005 express:

I use Me.Visible = False to hide form to systry when user click on entry in listbox, and this works fine.

But, when I put Me.Visible=False in Form_Load and start program, form is normaly visible. WTF?!? And I don't get any error...

Can someone explaint to me why this doesn't work?!?
Question by:Cro0707
    LVL 16

    Accepted Solution

    This happens because the form's load event is fired BEFORE the form is shown and the show method being called displays the form. I don't know the best practice for hiding the form immediately but you can add "Me.Visible = False" into the Form's "Shown" event.
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    Another way is to set the Forms Opacity property to ZERO at design-time.

    Then, from code at run-time, you can set it to 1 to make it visible.

    ***Note that in the IDE, the Opacity property goes from 0 to 100, but at run-time it goes from 0 to 1.


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
    For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now