LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric control used as date input won't behave.

I'm using a numeric control to input a date MMDDYY.  I'd like the "MMDDYY" to appear in the control as a prompt or guide for the user to input 102212 for 22Oct2012.  I can get the "MMDDYY" to appear but a date appears in front of it.  E.g. "10/22/2012 MMDDYY".

 

I can't get the 10/22/2012 to go away.  There must be a very easy solution to this that I'm missing.

0 Kudos
Message 1 of 8
(3,025 Views)

I do not see an easy way to do what I think you want. You want the MMDDYY to appear in the control and then disappear when the user starts typing numbers?

 

As an alternative make the Caption visible and type MMDDYY into the caption. Place it below or above the control.  It will always be there, but this might be better than no prompt.

 

10/22/2012 is a MM/DD/YYYY format.

 

Lynn

0 Kudos
Message 2 of 8
(3,021 Views)

show us your code, so that we can better understand ?

0 Kudos
Message 3 of 8
(3,015 Views)

@johnsold wrote:

I do not see an easy way to do what I think you want. You want the MMDDYY to appear in the control and then disappear when the user starts typing numbers?

 

As an alternative make the Caption visible and type MMDDYY into the caption. Place it below or above the control.  It will always be there, but this might be better than no prompt.

 

10/22/2012 is a MM/DD/YYYY format.

 

Lynn


Sounds more like a format issue than a value issue.  Use a dbl format appropriatly

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(3,008 Views)

There are millions of way to get the result you currently get or to get the result that you want to get, but if you don't show us what you are actually doing, we can only take wild guesses. I don't like guessing, so show us your code!

 

What is the format setting of the control? Do you use one of the time formats? What is the datatype?

(It almost seems to me you are using something like an advanced format string of "%<%m/%d/%y>T MMDDYY", because numeric controls cannot show random letters as part of the value. What if you would use a format of "%<%m/%d/%y>T" instead?

 

If you want a greyed out default string to appear when nothing is entered, you should use a string control, set it to update value while typing, and use an event structure to sanitize the input as it is entered, for example. (you should also vote for this idea).

 

0 Kudos
Message 5 of 8
(3,004 Views)

Test3Nov.JPG

 

 

Test3Nov2.JPG

0 Kudos
Message 6 of 8
(2,990 Views)

 

...Snip

"You want the MMDDYY to appear in the control and then disappear when the user starts typing numbers?  Yes, exactly.

 

As an alternative make the Caption visible and type MMDDYY into the caption. Place it below or above the control.  It will always be there, but this might be better than no prompt.

 

10/22/2012 is a MM/DD/YYYY format.  That would help.  Thanks.  I still think there's a way.

 

Lynn

0 Kudos
Message 7 of 8
(2,989 Views)

done.

0 Kudos
Message 8 of 8
(2,988 Views)