status form

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
Domtar
Posts: 59
Joined: Sun Mar 03, 2013 12:42 pm

status form

Post by Domtar » Mon Oct 29, 2018 8:09 am

hi,

I'm creating a GUI where I would like to show some status to the users by showing a new form with mouse_hover event but I do not know how to get rid of it afterwards.

here's part of the code to illustrate where I'm at now;

Code: Select all

$buttonCreation_MouseHover={
	Add-Type -AssemblyName System.Windows.Forms
	$hover = New-Object system.Windows.Forms.Form
	$hover.ShowDialog()
}

$buttonCreation_MouseLeave={
	$hover.Close()
}
The Mouse_Hover event works perfectly but the form doesn't close.

what am I missing?

thank you!

User avatar
Domtar
Posts: 59
Joined: Sun Mar 03, 2013 12:42 pm

Re: status form

Post by Domtar » Mon Oct 29, 2018 10:43 am

OK I got it. it was easy!

I changed ShowDialog() to Show() only.

thanks!

Locked