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.
This topic is 5 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Domtar
Posts: 133
Last visit: Mon Mar 11, 2024 5:38 am
Has voted: 2 times

status form

Post by Domtar »

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: 133
Last visit: Mon Mar 11, 2024 5:38 am
Has voted: 2 times

Re: status form

Post by Domtar »

OK I got it. it was easy!

I changed ShowDialog() to Show() only.

thanks!
This topic is 5 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked