Tabbing DateTimePicker gives a beep

  • Thread starter Thread starter Jayesh
  • Start date Start date
J

Jayesh

Hi
I have panel in which I have DateTimePicker. Here is the code

DateTimePicker datePicker = new DateTimePicker();
datePicker.Format = DateTimePickerFormat.Custom;
datePicker.CustomFormat = Constants.DisplayDateFormat;
datePicker.Font = mycustomFont;
datePicker.ShowUpDown = false;
datePicker.Size = new Size(Constant,Constant)

When I hit tab on DateTimePicker control to move focus to next TextBox
control in the panel, it is giving a beep. Please help.
 
I am using .NET CF 2.0 C# in windows mobile 5.0 device.

I tried using OPENNETCF datetimepicker2. It is also having some
beeping issue. I also tried windows application having DateTimePicker
that also giving same problem. Is there any way to get rid of the
beep?

Thanks,
Jayesh Modha
 
Hi Jayesh,

On DateTimePicker Control keypress event, by pass the default
control's handling.

private void dateTimePicker1_KeyPress(object sender, KeyPressEventArgs
e)
{
if ((e.KeyChar == '\t'))
{
e.Handled = true;
}
}

Hope this helps,
Cheers,
Arun
www.innasite.com
 
Hi Jayesh,

On DateTimePicker Control keypress event, by pass the default
control's handling.

private void dateTimePicker1_KeyPress(object sender, KeyPressEventArgs
e)
{
if ((e.KeyChar == '\t'))
{
e.Handled = true;
}
}

Hope this helps,
Cheers,
Arunwww.innasite.com

Arun,

Thanks a lot for solution. it works fine.

Thanks,
Jayesh Modha
 
Back
Top