LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you set Value for DateTimePicker .NET control?

Solved!
Go to solution

I am using DateTimePicker .NET controls to allow users to select a Timestamp. This works great and you simply read the "Value" property of the .NET control into a Timestamp. The problem I am having is reversing this process. I am trying to set the Value property using a Timestamp. I always get the error, "The datatype of the variant is not compatible with the data type wired to the type input." I have tried To Variant, To .NET Object, and other conversions but I can't seem to get it right. What is the Variant that corresponds to the Value property? And how do I convert a LV Timestamp into this Variant?

0 Kudos
Message 1 of 3
(3,672 Views)
Solution
Accepted by topic author Arcus111

I am able to set the Date Time Picker value with a time stamp. Could you post your VI?

 

 

Message 2 of 3
(3,657 Views)

Thanks for the example. I had actually just discovered my problem prior to seeing your post. Turns out I was using the wrong Value property node. I was using the one from the LV control and not from the System.Windows.Forms.DateTimePicker class. I switched to the class specific one and it is all working great now. As usual, it ended up that I was just doing something stupid. Thanks for the help.

0 Kudos
Message 3 of 3
(3,647 Views)