Results 1 to 2 of 2

Thread: FrmMain Hide

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Philadelphia
    Posts
    47

    Exclamation FrmMain Hide

    I am attempting to hide my main form in VB.NET and it is not working. I was wondering if there was something wrong witht he way that i am doing it.

    Here is two ways that i have tried.

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         NotifyIcon1.Icon = Me.Icon ' Just for my notify icon
    3.         LoadIp() ' a function to load ip info
    4.         me.visible = false ' NOT WORKING
    5.     End Sub

    And i also tried creating a sub main

    VB Code:
    1. Public Class Class1
    2.     Public Shared Sub Main()
    3.         Dim x As New frmMain()
    4.         x.Visible = False
    5.         Application.Run(x) 'also attempted x.show, but this just exits
    6.     End Sub
    7. End Class

    Can anyone help?
    U S A
    Visual Studio .NET
    Windows XP

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    simply like this :
    VB Code:
    1. Private Sub Form1_Activated(ByVal sender As Object, ByVal e_
    2. As System.EventArgs) Handles MyBase.Activated
    3.         Me.Hide()
    4.         'or
    5.         'Me.Visible = False
    6.     End Sub

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