Textbox Dates

  • Thread starter Thread starter Dennis D.
  • Start date Start date
D

Dennis D.

Thanks for reading this.

Textbox named txtStartTime

I want the user to use a textbox to put in a number like 6:30 or 6.30, and
converting it with code to 6:30AM after moving to the next textbox using
either a tab or enter key. I'll be manipulating the results by adding and
subtracting numbers as hours and minutes in later textboxes.

Sounds simple, but I'm just learning with Balena's Programming VB.net, the
MS VB.net Language Ref., VB.net, Framework Docs, et al. I've been trying for
hours to do this, and it's just going South on me.

Help would be appreciated.
 
* "Dennis D. said:
Textbox named txtStartTime

I want the user to use a textbox to put in a number like 6:30 or 6.30, and
converting it with code to 6:30AM after moving to the next textbox using
either a tab or enter key. I'll be manipulating the results by adding and
subtracting numbers as hours and minutes in later textboxes.

<URL:http://www.codeproject.com/cs/miscctrl/maskedcsedit.asp>
<URL:http://www.codeproject.com/vb/net/maskedbox_control.asp>
<URL:http://www.codeproject.com/vb/net/validtext3.asp>
<URL:http://www.codeproject.com/vb/net/cpflexmaskeditbox.asp>
<URL:http://www.codeproject.com/useritems/ValidText.asp>
....
 
I know this is tough.
I'm working in VB.net
I want to manipulate the date, dateformat, or datevalue within an event such
as anything_enter or anything_tab.
like: txtStartTime.text = dateformat(HH:mm),
but I get an error that says I can't enter a function within a sub,
and I'm totally lost about accepting a string and converting it to a custom
date, that is, not vbShortDate, or toShortTime.
I heard there is a property something like
textbox.txtStartTime.inputstring...
Specifically, I want the user to enter a 5 digit string like 6.30 and
convert it to 06:30AM or 18.30 into 06.30PM in the textbox after the control
loses focus. Then I want to use another control.textbox to subtract 4 hours
and 20 minutes from 6:30AM and return the remainder (2:10AM) as
control.textbox.textboxName.text.

I'm more interested in using the date constructs than the validation method
(as in masking). I downloaded the mask examples, but honestly I haven't had
a chance to look at the code, just the screenshots. I think the programming
language is CSharp, but that shouldn't make any difference right, because
the code is drawing from System.Forms?

Thanks.
 
Back
Top