Results 1 to 7 of 7

Thread: How to hide the form?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    21

    How to hide the form?

    I want to Hide the form when the application start.
    I write :
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.Hide()
    End Sub

    But when the application start, I still see the form.
    The form doesn't hide.......
    How could I do?

    Thanks.

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    I had the same problem before and I couldnt solve it. One easy way that you could get it to work is to set the opacity of the form to zero, it works perfect but it may not be the "correct" way to do this.
    I also tried to load a form in a module and and make it invisible, I dont remember if that one worked or not, but you can try the opacity thingie
    good luck
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261
    In the form's constructor, you could set the visible property to false.

    Code:
    Public Class Form1
        Inherits System.Windows.Forms.Form
    
    #Region " Windows Form Designer generated code "
    
        Public Sub New()
            MyBase.New()
    
            'This call is required by the Windows Form Designer.
            InitializeComponent()
    
            'Add any initialization after the InitializeComponent() call
            me.visible = false
    
         End Sub
    
    ...
    ...
    ...

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Doesnt work
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261
    I have an idea, run your program from Sub Main rather than from a form! Then, you can show your form whenever you want.

    Just go into project propreties, and set the startup object to Sub Main. Then, make a 'loader' class like the one listed.

    Code:
    Public Class Loader
    
         Public Shared Sub Main()
    
              'Do whatever you need to do in here
    
         End Sub
    
    End Module
    Remember, if you want to keep your application running after Sub Main terminates, call System.Windows.Forms.Application.Run().

  6. #6
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    well I had a problemmo with doing that before. I cant really remember what it was. You think it's gunno work and then it doesnt, like the visible thingie that you had in your code. Anyways the easiest way is to set the opacity to zero


    one question: if you run your app by application.run, can you access the form's properties and set the visible property to false?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    21

    Thanks everyone!

    I think the opacity=0 is a good method.....

    thanks everybody
    especially Mr.MrPolite

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width