Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Need some help getting a form to acknowledge doubleclick event.

$
0
0

Script: http://pastebin.com/EjThp0NU (fixed as described in edit #2) I’d like to get an event handler for double click on my slide show script, when I try to add one with the commented out “$form.add_DoubleClick=({$form.Close();})” I get this error: Exception setting “add_DoubleClick”: “Cannot set the Value property for PSMemberInfo object of type “System.Management.Automation.PSMethod”.” At C:Usersjrg26DocumentsWindowsPowerShellslideshow.ps1:77 char:1 + $form.add_DoubleClick=({$form.Close();}) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], SetValueInvocationException + FullyQualifiedErrorId : ExceptionWhenSetting

And then the pictures do not load, just a black screen. My end goal, is to be able to take some input (ideally double click) and throw up a dialog that asks to delete the picture, in case there’s any pro’s that can help me with all that.. edit: Oh and the pinvoke is just to reset the Windows monitor sleep count down so the monitor does not sleep while displaying the slide show.

Edit #2: I figured something out, wasn’t supposed to have the ‘=’ in the add_doubleclick statement, but it still does not close $form when double clicked.

submitted by /u/JamesG269
[link] [comments]

The post Need some help getting a form to acknowledge doubleclick event. appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles