Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi everybody.
I need input time but i still not find control suitable.
how to using control input time the same?
thanks for help.
Posted
Comments
Sergey Alexandrovich Kryukov 13-Mar-12 1:19am    
Did you simply try to look at MSDN for System.Windows.Forms? The answer would just catch your eye pretty fast...
--SA

Try this code for time entry:

XML
<asp:TextBox ID="txtStartTime" runat="server" Text='<%# Bind("StartTime", "{0:t}") %>' Width="60px"></asp:TextBox> 

<asp:Label ID="lblStartTimeEdit" runat="server" Text="Press 'A' or 'P' to switch AM/PM"></asp:Label>

<cc1:MaskedEditExtender ID="meeStartTime" runat="server" AcceptAMPM="true" MaskType="Time" Mask="99:99" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" ErrorTooltipEnabled="true" UserTimeFormat="None" TargetControlID="txtStartTime" InputDirection="LeftToRight" AcceptNegative="Left">
</cc1:MaskedEditExtender>

<cc1:MaskedEditValidator ID="mevStartTime" runat="server" ControlExtender="meeStartTime" ControlToValidate="txtStartTime" IsValidEmpty="False" EmptyValueMessage="Time is required " InvalidValueMessage="Time is invalid" Display="Dynamic" EmptyValueBlurredText="Time is required " InvalidValueBlurredMessage="Invalid Time"
 
Share this answer
 
Comments
Tuanth 13-Mar-12 0:53am    
I using winform but I don't use webform.
Dave Kreskowiak 13-Mar-12 14:30pm    
Reverse your thinking a bit. You assume everyone is working in ASP.NET. Don't. Assume everyone is work in Windows Forms, unless otherwise specified.
This one: System.Windows.Forms.DateTimePicker, http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900