Hi,
Within my $form_load statement blocks, my script checks for a running process, if that process is running, two buttons are then disabled, however I want those buttons to be enabled when the mouse enters the button(s).
I have had a play around with the events for Mouse Enter and Mouse Leave which work but only once? When the mouse re-enters the control for the second time it remains disabled?
What is the best way to achieve this?
Thanks
Mouse Enter Event
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.
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.
Re: Mouse Enter Event
There is no normal reason for this. Without a code sample there is no way to answer.
Create a simple form with only the code needed to demonstrate the issue and upload it. Someone will take a look at it.
Create a simple form with only the code needed to demonstrate the issue and upload it. Someone will take a look at it.
Re: Mouse Enter Event
- $form1_Load={
- $Check = Get-Process -Name OUTLOOK
- if ($Check)
- {
- $button1.Enabled = $false
- $button2.Enabled = $false
- }
- }
- $button1_MouseEnter={
- $button1.Enabled = $true
- }
- $button1_MouseLeave={
- $button1.Enabled = $false
- }
Re: Mouse Enter Event
If you disable a button it won't receive any events.
See attached example.
See attached example.
- Attachments
-
- Test-Buttons.psf
- (26.29 KiB) Downloaded 115 times