Hi,
I my gui, I have moved a button to a different tab page, since then it is not responding when publishing my project (= making an exe of it and running it).
The button works fine when I launch the project in PS Studio, not anymore when in the exe.
Tried to recreate the button but didn't help. Checked the code and it is correct. The code behind the button make the button disable when code executes and re-enable it afterwards but that does not happen also.
Any idea what might cause this? Hope this would be a known issue which has a woraround.
Thanks.
S.
Button not working after move to other tab(?)
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: Button not working after move to other tab(?)
It is most likely that the button is not hooked to the event. It is also possible that your project is somehow corrupted. Remove all build and temp files from the project and rebuild.
Re: Button not working after move to other tab(?)
Thanks, but if the button would not be linked to the code, it would not work in the project when I launch it in PS Studio either, right?
Note: how do I remove all "temporary files" from a project?
Note: how do I remove all "temporary files" from a project?
Re: Button not working after move to other tab(?)
Recreate the project by copying all project forms to a new project.
There is no reason why this wouldn't work in an EXE assuming the files are not damaged in some way.
Start by creating a new project with a minimal example of the failure. Chances are you cannot reproduce the issue in a new project. If you can post the new simple project as an example.
There is no reason why this wouldn't work in an EXE assuming the files are not damaged in some way.
Start by creating a new project with a minimal example of the failure. Chances are you cannot reproduce the issue in a new project. If you can post the new simple project as an example.
Re: Button not working after move to other tab(?)
Thanks. I copied my project and removed the temporary files which solved the issue.
One more thing: a specific ps1 is dissapearing all the time from my project.
Just try to understand: when I refer to a ps1 in my project, f.e. Import-Module "$ScriptsFolder\mymodule.ps1", do I need to add the folder in the project (add folder, then add existing files) or is it sufficient the folder is there to have them available in the exe?
Just wonder when I need to add the files in the project, I guess only when editing is needed in the GUI. Hope my question is clear(?)
One more thing: a specific ps1 is dissapearing all the time from my project.
Just try to understand: when I refer to a ps1 in my project, f.e. Import-Module "$ScriptsFolder\mymodule.ps1", do I need to add the folder in the project (add folder, then add existing files) or is it sufficient the folder is there to have them available in the exe?
Just wonder when I need to add the files in the project, I guess only when editing is needed in the GUI. Hope my question is clear(?)
Re: Button not working after move to other tab(?)
The module has to be distributed with your project or must exist on the target system. WHat I see is that you are trying to load a script (PS1) file as a module. That does not make it a full module. (PSM1)
Re: Button not working after move to other tab(?)
Thanks for that.I'll change it into a psm1.
I mentioned that I copied the script to a new one and everything was solved. I meant that I deleted some tempfiles, but not all issues are solved apparently. Some buttons still don't work.
So I'd like to start a new project and copy all items over. However, I don't understand how I should do this. Start new project folder outside PS Studio, then copy only the project files over, start PS Studio, import them one by one (didn't see an option to import more then one file at once)?
I mentioned that I copied the script to a new one and everything was solved. I meant that I deleted some tempfiles, but not all issues are solved apparently. Some buttons still don't work.
So I'd like to start a new project and copy all items over. However, I don't understand how I should do this. Start new project folder outside PS Studio, then copy only the project files over, start PS Studio, import them one by one (didn't see an option to import more then one file at once)?