Run Multiple functions from an onclick event

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Ivan Ivan 3 weeks, 1 day ago.

  • Author
    Posts
  • #74308
    Profile photo of Simon B
    Simon B
    Participant

    I have a form created in Powershell 5 and when I click it it calls a function called getupdates. I have several other functions on the form that I would like to run once the getupdates function has completed i.e. when I click Start it runs getupdates then another function and when that has finished it runs another function etc. Any ideas how I can run multiple functions from one onclick event ? Do I need to put them in a scriptbocl and call that in the onclick event ? If so how do I do this?

    $Buttonst = New-Object System.Windows.Forms.Button
    $Buttonst.Location = New-Object System.Drawing.Size(400,100)
    $Buttonst.Size = New-Object System.Drawing.Size(110,80)
    $Buttonst.Text = "Start"
    $Buttonst.Add_Click({getupdates})

  • #74317
    Profile photo of Ivan
    Ivan
    Participant

    You could call a Function which calls the others, I think that would be more organized.

You must be logged in to reply to this topic.