0

just to clarify can we execute codes after we application.run? I would like to hide the form as well. Act as dummy to be precise.

Application.Run(); Calling another method(Is it possible?)

H H
  • 263,252
  • 30
  • 330
  • 514
Thasleem Arif
  • 29
  • 1
  • 4
  • When your app is done it is done, no way to execute more code, except you call your app from another one. However you can also open and close more than one single form within your app. – MakePeaceGreatAgain Jan 10 '17 at 10:53
  • I just need to trigger my search function. And for that i need the form to be up and continue executing the code. – Thasleem Arif Jan 10 '17 at 10:58
  • 1
    Can you please elaborate what exactly you´re trying to do? It sounds like you think closing your app is the solution which it certantly is not, but *why* you think this isn´t clear to me. Please update your question with a few more details. – MakePeaceGreatAgain Jan 10 '17 at 11:03
  • I just have to hide the application while its running, and continue executing the methods. – Thasleem Arif Jan 10 '17 at 11:08
  • 1
    So why do you even use a form if it should never show up? Maybe just use a console-app instead? Anyway maybe [this](http://stackoverflow.com/questions/2686289/how-to-run-a-net-console-app-in-the-background) will hellp you. – MakePeaceGreatAgain Jan 10 '17 at 11:11

1 Answers1

0

At some point (e.g. the start) you want to make your form hidden (Form.Hide()) and then do the work in a BackgroundWorker or something ... if you need to show your form for something again bring it back with Form.Show().

You could put code after your form has closed completely if you wanted to as well.

noelicus
  • 14,468
  • 3
  • 92
  • 111