Codessentials

  • Increase font size
  • Default font size
  • Decrease font size
Home Coding tips .Net How to prevent an application to show at startup

How to prevent an application to show at startup

If you do not want the main form to show on startup you can use the following strategy:

1) override the method SetVisibleCore of your main form:
Private mShow As Boolean = False

Protected Overrides Sub SetVisibleCore(ByVal value As Boolean)
'--- Prevent form from being shown at startup
If Not mShow Then value = False
MyBase.SetVisibleCore(value)
End Sub
2) then if the form needs to be shown you call this method:
Private Sub ShowMe()
mShow=true
me.visible = true
End Sub
This method can for example be called in the click-event of a NotifyIcon

 

Bookmark

AddThis Social Bookmark Button

Related Articles


Newsflash

If you like freeware, if you like what we do, why not support us?

It does not cost you anything! Click here to support us for free!