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.
jvierra
Posts: 14155
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: how to use DateTimePicker

Post by jvierra » Tue Feb 11, 2020 7:57 am

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: 71
Joined: Sun Mar 03, 2013 12:42 pm

Re: how to use DateTimePicker

Post by Domtar » Tue Feb 11, 2020 10:57 am

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: 14155
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: how to use DateTimePicker

Post by jvierra » Tue Feb 11, 2020 3:43 pm

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: 71
Joined: Sun Mar 03, 2013 12:42 pm

Re: how to use DateTimePicker

Post by Domtar » Wed Feb 12, 2020 12:28 pm

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: 14155
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: how to use DateTimePicker

Post by jvierra » Wed Feb 12, 2020 1:48 pm

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: 71
Joined: Sun Mar 03, 2013 12:42 pm

Re: how to use DateTimePicker

Post by Domtar » Wed Feb 12, 2020 6:46 pm

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!

Post Reply