menachem680
asked on
vb.net access input mask
i have a database access + a vb.net form for the user by acess i have a input mask like this
00:00 1/12/1987 i need the same by vb,form on a textbox how can i make this it shulde by on the textbox???
00:00 1/12/1987 i need the same by vb,form on a textbox how can i make this it shulde by on the textbox???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would use a DateTimePicker control. check http://msdn.microsoft.com/en-us/library/4xyy1csh.aspx
ASKER
thanks but the user want to put a time not the time from now he want to put any time he want how do he make a input mask?
As mentioned above, there are 2 ways to do it: MaskedTextBox or DateTimePicker.
1. To implement MaskedTextBox, in design time, double click on MaskedTextBox in the Toolbox (See screen shot 1). Then change its Mask property to ##:## ##/##/#### (see screen shot 2).
2. To implement DataTimePicker, in design time, double click on DataTimePicker in to toolbox (see screen shot 3). Then change its Format property to Custom and set its CustomFormat property to HH:mm MM/dd/yyyy (see screen shot 4).
Hope it helps.
MaskedTextBox.PNG
Mask.PNG
DateTimePicker.PNG
Format.PNG
1. To implement MaskedTextBox, in design time, double click on MaskedTextBox in the Toolbox (See screen shot 1). Then change its Mask property to ##:## ##/##/#### (see screen shot 2).
2. To implement DataTimePicker, in design time, double click on DataTimePicker in to toolbox (see screen shot 3). Then change its Format property to Custom and set its CustomFormat property to HH:mm MM/dd/yyyy (see screen shot 4).
Hope it helps.
MaskedTextBox.PNG
Mask.PNG
DateTimePicker.PNG
Format.PNG
ASKER
so how does one (datepiker)get to my textbox with this ?
you get rid of your textbox, you replace it with the datetimepicker control
Just use ONE of them.
If using MaskedTextBox, do not use DateTimePicker. To get value from MaskedTextBox, use MaskedTextBox1.Text.
If using DateTimePicker, do not use MaskedTextBox. To get value from DateTimePicker, use DateTimePicker1.Value.
If using MaskedTextBox, do not use DateTimePicker. To get value from MaskedTextBox, use MaskedTextBox1.Text.
If using DateTimePicker, do not use MaskedTextBox. To get value from DateTimePicker, use DateTimePicker1.Value.
ASKER