Peculiar behavior

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 10 years and 5 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
kirunajekr
Posts: 6
Last visit: Thu Jan 18, 2024 1:20 am

Peculiar behavior

Post by kirunajekr »

I'm currently working on a GUI-project where I plan to gather some handy tools for AD, Exchange, Fileserver and so on in one tool.
During the work with this tool, using Powershell Studio I get some strange behavior that I can't understand.
This is what happens:
I can work on one tool for a while and work my way through the GUI-components and their events. Of course there will be errors during development of the events but nothing that can't be solved.
The strange thing is that once I leave finished components and move on to others, an event that previously worked fine stops working all of a sudden, without me touching it. If I then double-click the components to go to the onClick, it's still there, containing all the code it used to when it worked.
What I've found working so far is, I copy all the code from inside the event, and remove the event. I then make a new event completely the same and paste the code back. Then it works again.

Have anyone else had these problems and if so, did you find any cause/solution to them?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Peculiar behavior

Post by jvierra »

This is very common while you are learning. It is caused by making changes that you do not realize overwrite other elements. There is no way for us to know exactly what you are doing wrong.

I recommend starting bygoingthrough all or most of the examples in the blog on this site. It is a very good walk-through of how to design and build forms.

Do not try to do very complex things until you understand how this works. Working is evented systems is not like other scripting or other tools/systems. You must learn how the event system dispatches and handles events. Once that is understood you can use online documentation to review how each control behaves.

The edit environment also has behaviors that you will have to learn. It will come slowly at first but you will eventually catch on. The basics cannot be easily guessed at. You really must use a learning tool.

Start here http://www.sapien.com/blog/2013/10/16/p ... oolmaking/

Then here -> http://www.sapien.com/blog/topics/user- ... istrators/
User avatar
Alexander Riedel
Posts: 8489
Last visit: Thu Apr 18, 2024 1:15 pm
Answers: 20
Been upvoted: 37 times

Re: Peculiar behavior

Post by Alexander Riedel »

When this happens again, export your code as a script and run that script outside PowerShell Studio. Does it do the same thing?
If so you changed something that broke or disconnected the event handler.
If it doesn't, please email the .pff and the exported script to support@sapien.com and point out which exact event handler you have trouble with. We are happy to check.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
kirunajekr
Posts: 6
Last visit: Thu Jan 18, 2024 1:20 am

Re: Peculiar behavior

Post by kirunajekr »

Alexander Riedel wrote:When this happens again, export your code as a script and run that script outside PowerShell Studio. Does it do the same thing?
If so you changed something that broke or disconnected the event handler.
If it doesn't, please email the .pff and the exported script to support@sapien.com and point out which exact event handler you have trouble with. We are happy to check.
Cheers, I will do that.
I don't have time to work on it that often, but will make sure to remember this when I do.
User avatar
kirunajekr
Posts: 6
Last visit: Thu Jan 18, 2024 1:20 am

Re: Peculiar behavior

Post by kirunajekr »

jvierra wrote:This is very common while you are learning. It is caused by making changes that you do not realize overwrite other elements. There is no way for us to know exactly what you are doing wrong.

I recommend starting bygoingthrough all or most of the examples in the blog on this site. It is a very good walk-through of how to design and build forms.

Do not try to do very complex things until you understand how this works. Working is evented systems is not like other scripting or other tools/systems. You must learn how the event system dispatches and handles events. Once that is understood you can use online documentation to review how each control behaves.

The edit environment also has behaviors that you will have to learn. It will come slowly at first but you will eventually catch on. The basics cannot be easily guessed at. You really must use a learning tool.

Start here http://www.sapien.com/blog/2013/10/16/p ... oolmaking/

Then here -> http://www.sapien.com/blog/topics/user- ... istrators/
I will for sure check a few of the examples out. But limited development-time is why I bought your product in the first place. If I had the time to learn everything about events and forms I would have just had written the code myself instead of having PS Stud generate it for me.
This topic is 10 years and 5 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