Using this trick I can avoid the "ding" sound on the TextBox:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
e.Handled = True
End If
End Sub
But this does not work for the ComboBox:
Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
e.Handled = True
End If
End Sub
It seems that the combobox has a textbox inside and when the KeyPress event
of the combo is fired, the internal TextBox has emitted the "ding" sound.
In VB6, this did not happen with comboboxes, only with textboxes. <g>
Is there an easy workaround for this, before resorting to subclassing and
the such?
Best regards,
Carlos
private void mTaskDsp_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
// If the enter key is pressed, consider the task name entry
done
if( e.KeyCode == Keys.Enter )
{
CompleteAddTaskName();
}
}
Mike
"Carlos J. Quintero" <carlos_j_quinter...@hotmail.com> wrote
in message news:Oz30R$#0BHA.2620@tkmsftngp07...
Carlos
"Mike" <mtsch...@earthlink.net> wrote in message
news:#V4Mv2A1BHA.2308@tkmsftngp04...