You give up to quickly!!! I also posted in vb.enteprise. Note my reply
below:
I FIGURED IT OUT. Below you will find the code. Y0ou may want to post this
as a sample.
Note the lines in New, Load, and Menuitem Click are all neccessary.
Otherwise you ALT-TAB will start off, or form visible, or MenuItem Click
will not display it the first time.
Public Class Form1
Inherits System.Windows.Forms.Form
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
Me.WindowState = FormWindowState.Minimized
Me.Visible = False
Me.Hide()
End Sub
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem1.Click
Me.Show()
Me.WindowState = FormWindowState.Normal
Me.Visible = True
Me.ShowInTaskbar = True
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Hide()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Me.WindowState = FormWindowState.Minimized
Me.Hide()
End Sub
End Class
Lewis
"Peter Huang" <v-phuang@online.microsoft.com> wrote in message
news:ZvQkkzE9DHA.1992@cpmsftngxa07.phx.gbl...[color=blue]
> Hi Lewis,
>
> Thanks for your quick reply.
>
> To prevent the appliation was activated by using Alt-Tab, I think you may
> simply set its to hide, so that it will be elimitated from the Task List,
> which will achieve. You may hide the form by click a button, if you wants
> to do it by click the minimized button, you may need to override the
> winproc and handle the message yourself.
>
>
> Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MenuItem1.Click
> Me.WindowState = FormWindowState.Normal
> Me.Show()
> End Sub
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Me.Hide()
> End Sub
>
> Public Class MyForm
> Inherits System.Windows.Forms.Form
> Public Const WM_SYSCOMMAND = &H112
> Public Const SC_MINIMIZE = &HF020
> Protected Overrides Sub WndProc(ByRef m As[/color]
System.Windows.Forms.Message)[color=blue]
> If m.Msg = WM_SYSCOMMAND And m.WParam.ToInt32 = SC_MINIMIZE Then
> Me.Hide()
> Me.WindowState = FormWindowState.Minimized
> Return
> End If
> MyBase.WndProc(m)
> End Sub
> End Class
>
> You may try my suggestion and let me know the result.
>
>
> Best regards,
>
> Peter Huang
> Microsoft Online Partner Support
>
> Get Secure! -
www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no[/color]
rights.[color=blue]
>[/color]
"Tian Min Huang" <timhuang@online.microsoft.com> wrote in message
news:ZTxKQuG9DHA.3472@cpmsftngxa07.phx.gbl...[color=blue]
> Hello Lewis,
>
> Thanks for your post. As I understand, you are looking for the replacement
> of App.TaskVisible in VB .NET. I'd like to share the following information
> with you:
>
> 1. As you know, there is no equivalent for the TaskVisible property in
> Visual Basic .NET, because such tasks generally run at background. Please
> refer to the following MSDN article:
>
> TaskVisible Property Changes in Visual Basic .NET
>[/color]
http://msdn.microsoft.com/library/de...us/vbcon/html/[color=blue]
> vbcontaskvisiblepropertychangesinvisualbasicnet.as p?frame=true
>
> 2. To work around the problem, I suggest that you can create two projects,
> one is a Service, the other is a WinForm application. The Service is
> responsible for background data manipulation say, synchronizing data
> between QB and SQL, data comparison, batch updates, etc. While the WinForm
> application provides the user interface only, it forwards the user[/color]
commands[color=blue]
> to Service and displays the result.
>
> Does this help?
>
> Regards,
>
> HuangTM
> Microsoft Online Partner Support
> MCSE/MCSD
>
> Get Secure! --
www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>[/color]