I am developing a web application where i am showing the calender for the date and start and end time. For the display of time there is no such control as in windows.form like numericupdown in asp.net.
so i used 3 textboxes and 2 buttons which resembles the control for windows timer setting
CODE
<div>
<p>
<asp:Label ID="Label1" runat="server" Text="Label">Time-in (h:mm)</asp:Label>
<asp:TextBox ID="TextBox1" runat="server" CssClass="noright" Height="16px" Width="20px" MaxLength="2" OnTextChanged="TextBox1_TextChanged" AutoPostBack="true"></asp:TextBox><asp:TextBox ID="TextBox3" runat="server" CssClass="noleftright" ReadOnly="True">:</asp:TextBox><asp:TextBox ID="TextBox4" runat="server" CssClass="noleft" Height="16px" Width="20px" MaxLength="2" AutoPostBack="True" OnTextChanged="TextBox4_TextChanged"></asp:TextBox><span id="Span1" style="width:20px; height:11px; font:bold 7px Webdings;"><input type="button" name="btnUp1" value="5" title="Increase"/><input type="button" name="btnDn1" value="6" title="Decrease"/></span>
</p>
</div>
and the c# code
CODE
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
if (Int32.Parse(TextBox1.Text)> 23)
{
TextBox1.Text = "23";
}
else if (Int32.Parse(TextBox1.Text) < 0)
{
TextBox1.Text = "0";
}
}
protected void TextBox4_TextChanged(object sender, EventArgs e)
{
if (Int32.Parse(TextBox4.Text) > 59)
{
TextBox4.Text = "59";
}
else if (Int32.Parse(TextBox4.Text) < 0)
{
TextBox4.Text = "0";
}
}
iam not able to handle the event for mouse click event on the textbox, so that i can get a spinner look for the text box....and can also increment the values on the button click event .
is there any other way to do this.....?
Please help....