By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,747 Members | 1,328 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,747 IT Pros & Developers. It's quick & easy.

WindowState.Minimized vs. Me.Hide

P: n/a
Using the below code, If I use Me.WindowState=Minimized the program runs
fine, but you have the taskbar showing the program running.

If I use Me.Hide instead, the program immediately exits.

If UCase(Microsoft.VisualBasic.Command) = "/SILENT" Then
Me.WindowState = FormWindowState.Minimized
silent = True
For i As Integer = 0 To clbPCs.Items.Count - 1
clbPCs.SetItemChecked(i, True)
Next
Button1.PerformClick()
Application.Exit()
End If

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Try Me.Visible = False (just an idea), rather than Me.Hide ().

"Terry Olsen" <to******@hotmail.com> wrote in message
news:O7**************@tk2msftngp13.phx.gbl...
Using the below code, If I use Me.WindowState=Minimized the program runs
fine, but you have the taskbar showing the program running.

If I use Me.Hide instead, the program immediately exits.

If UCase(Microsoft.VisualBasic.Command) = "/SILENT" Then
Me.WindowState = FormWindowState.Minimized
silent = True
For i As Integer = 0 To clbPCs.Items.Count - 1
clbPCs.SetItemChecked(i, True)
Next
Button1.PerformClick()
Application.Exit()
End If

*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #2

P: n/a
"Terry Olsen" <to******@hotmail.com> schrieb:
Using the below code, If I use Me.WindowState=Minimized the program runs
fine, but you have the taskbar showing the program running.

If I use Me.Hide instead, the program immediately exits.

If UCase(Microsoft.VisualBasic.Command) = "/SILENT" Then
Me.WindowState = FormWindowState.Minimized
silent = True
For i As Integer = 0 To clbPCs.Items.Count - 1
clbPCs.SetItemChecked(i, True)
Next
Button1.PerformClick()
Application.Exit()
End If


You are calling 'Application.Exit', and thus your application exits. In
addition to that, the form is invisible, so 'Button1.PerformClick' won't
raise the button's 'Click' event.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.