how to use DateTimePicker

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 4 years and 1 month 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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to use DateTimePicker

Post by jvierra »

It works fine for me. I suggest that you have a system issue. Are you running it in the correct threading model?
User avatar
Domtar
Posts: 133
Last visit: Mon Mar 11, 2024 5:38 am
Has voted: 2 times

Re: how to use DateTimePicker

Post by Domtar »

you mean as a 64-bit v5 of PS?

i also think it's a system issue, i just have no idea how to fix it.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to use DateTimePicker

Post by jvierra »

I tested with all threading models and PS versions and cannot reproduce the failure. Create the PS1 file and try outside of PSS. If the same thig happens then you have issues with some system component. You will have to take normal system troubleshooting and repair steps to find and fix the issue.
User avatar
Domtar
Posts: 133
Last visit: Mon Mar 11, 2024 5:38 am
Has voted: 2 times

Re: how to use DateTimePicker

Post by Domtar »

i tried creating a ps1 file with all the controls definitions, and it does the same. i copy / pasted an example piece of code from google, same issue.

i have no idea why it behaves like this and i'm now without solution regarding this issue.

now i'm looking for a way to simulate that control's behavior with some other controls
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to use DateTimePicker

Post by jvierra »

You need to fix your system. Something has damaged your Net Framework or the underlying API that DTP uses. This can be caused by disk corruption, by installing bad software or by malware.
There is no replacement in WinForms for the DTP control. It is also used all over Windows apps.
User avatar
Domtar
Posts: 133
Last visit: Mon Mar 11, 2024 5:38 am
Has voted: 2 times

Re: how to use DateTimePicker

Post by Domtar »

yes, i now have the same conclusion.

if i compile my script as an exe and try it, the control works as expected. also, the same script works correctly in PS Studio for my co-worker.

I'll see if I can repair my system.

thank you for your time & efforts!
This topic is 4 years and 1 month 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