Q:

How to call a function after running winform application

I am built same win Form  that opens some website with webBrowser after this i need to run runMyfunction,but this doesn't happens. 
Then i run runMyfunction, all stops and when i debug it it stays on 
Application.Run(new Form1());

What i am missing here? This my code :
namespace UmbWin
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            //I tried this also
            //Form1 myForm = new Form1();
            //myForm.Show();
            //myForm.runMyfunction()- doesn't do anything

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }  
    }
}
public Form1()
{
    InitializeComponent();
}
[STAThread]
private void Form1_Load(object sender, EventArgs e)
{
    string authHeader = "User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)";
    webBrowser.Navigate("https://www.test.com/Default.aspx", null, null, authHeader);

    runMyfunction();
}      
public void runMyfunction()
{
    //here where it stops and does nothing
    HtmlElement head = webBrowser.Document.GetElementById("123");
    HtmlElement scriptEl = webBrowser.Document.CreateElement("script");
}

A:

That is because Application.Run will only complete once the main form of the application is closed.
Application.Run runs the message loop (it checks for clicks and other Windows events. Read up on how Windows / Win32 works if you don't know what this all means). It is meant to run forever.
Your runMyfunction will only run once after the Navigate call. That's all. If you want to run it after every navigate, subscribe to the DocumentCompleted event.

