Janki
Janki

Reputation: 71

how to handle mouse click in powershell

I have and text box in and I want to clear the text box when the mouse click is happen , I am using PrimalForms to use powershell with GUI.

Upvotes: 0

Views: 2872

Answers (1)

Shay Levy
Shay Levy

Reputation: 126722

Put the code to clear the text box on the click event handler. For example, clicking button1:

$handler_button1_Click={
    $textbox1.Text=''
}

Here's how to add the click event handler directly to button1 (without using PrimalForms):

$button1.add_Click( {$textbox1.Text=''})

Upvotes: 1

Related Questions