Strange issue - Form Buttons

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

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 11 years and 2 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.
User avatar
kryten
Posts: 45
Last visit: Fri Dec 25, 2020 7:46 am

Strange issue - Form Buttons

Post by kryten »

Hi,
First up - Thanks for the recent deal on Powershell Studio 2012! I'm really enjoying the program and very impressed with the stability of the product over and above PrimalForms 2011.

However, a little issue has cropped up on each of the two small form based scripts I've worked on since installing it and just this moment been able to reproduce it in a test form script.

What seems to be happening is that button_click event script blocks seem to spontaneously stop "firing" on the click. has even happened to my "Quit" buttons which only ever really do a $form1.close()

The first couple of times this happened I ended up commenting out, removing and generally messing about with the code in the script block, gradually simplifying what the script block does until it dawns on me that nothing, not even a write-host "Yes, I got this!" works.

What seems to get the button/event/block working again is going back to the form designer and double-clicking on the button. This takes you to the _Click event code block. You don't have to do anything else at all, as the code in the block will now run fine when the button is clicked when the script is running. The visible code in the editor does not appear to change it any way after the double-click.

I am not sure exactly what triggers the issue to start (I am still testing and trying to get it to happen with as simple a scenario as possible), but when it does happen I am sure the only way to get the script block to start working again is to double click the button in the "design" view - of that I am certain.

Makes no difference whether using Posh V2 or V3.

I am using PoshStudio 3.1.15. Windows 7 Enterprise 32 bit on a Lenovo T400 thinkpad.

Now that I know how to work around it, it's no biggie as it only takes a second to flip back to design view and double click on the buttons that have stopped working to get them running again.

Regards,
Stuart
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Strange issue - Form Buttons

Post by davidc »

Thank you for the kind words. I'm not quite sure what is happening to your button events. If you can post or email us (support@sapien.com) a sample form that demonstrates the problem, I will be happy to look at it. You might want to export the script when it fails and compare it to an export of when it is successful. This way we can be sure nothing is changing.

David
David
SAPIEN Technologies, Inc.
This topic is 11 years and 2 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.