Different computers - different bugs ?

  • Thread starter Thread starter Eugene
  • Start date Start date
E

Eugene

Hello all,
I'm stuck here (nothing new in this world).
I have a program, that runs fine on my computer (where I actually
developing C# Windows app), but appears to be buggy on another
computer.
Same Windows versions, same .NET Framework...
Is there something I am overlooking ?
Below I have a function code, which works on my computer, but does not
on another:

// Autocomplete the combobox
private void cbMake_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{

int position = 0;
if (e.KeyChar > 31)
{
position = cbMake.Text.Length;
this.cbMake.SelectedIndex = this.cbMake.FindString(this.cbMake.Text);
this.cbMake.Select(position, this.cbMake.Text.Length - position);
}
}

Any ideas ?
 
Eugene said:
Hello all,
I'm stuck here (nothing new in this world).
I have a program, that runs fine on my computer (where I actually
developing C# Windows app), but appears to be buggy on another
computer.
Same Windows versions, same .NET Framework...
Is there something I am overlooking ?
Below I have a function code, which works on my computer, but does not
on another:

// Autocomplete the combobox
private void cbMake_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{

int position = 0;
if (e.KeyChar > 31)
{
position = cbMake.Text.Length;
this.cbMake.SelectedIndex = this.cbMake.FindString(this.cbMake.Text);
this.cbMake.Select(position, this.cbMake.Text.Length - position);
}
}

Any ideas ?

A different keyboard?

FB
 
Hello Eugene,

I'd suggest you use the KeyChar event if you need to capture character input
and react accordingly.
The KeyPress event is better for capturing keystorkes which don't produce
printable characters.
 
Back
Top