W
Wiktor Zychla
in my application I sometimes use KeyPress event. in the event handler I
have to check the char the user is trying to type.
in NTs everything is correct. however on W98 I've noticed that the character
given in
e.KeyChar (e is KeyPressEventArgs of course)
is NOT correctly converted ToString() when I type polish specific letters!
instead of the letter 'polish l' I get '3', instead of 'polish z' I get '?'
and so on.
it seems that the KeyChar reported in KeyPressEventHandler cannot handle
these specific letters. this bug seems to stick deeply inside the .NET
libraries because in any other case the polish specific letters are
correctly converted to their string equivalents.
I consider this as a painful bug, however I would really like to hear from
an expert about it. I am also really curious if this bug affects other
localized versions of W98 (for example german, french, turkish etc.)
Regards,
Wiktor Zychla
shortest example:
using System;
using System.Windows.Forms;
using System.Drawing;
public class CForm : Form
{
TextBox t;
public CForm()
{
t = new TextBox();
t.KeyPress += new KeyPressEventHandler( tkp );
this.Controls.Add( t );
}
// type any culture specific letter
// in polish W98 you will not see the letter you've typed
// it seems to be a severe bug
void tkp( object sender, KeyPressEventArgs e )
{
MessageBox.Show( e.KeyChar.ToString() );
}
public static void Main()
{
Application.Run( new CForm() );
}
}
have to check the char the user is trying to type.
in NTs everything is correct. however on W98 I've noticed that the character
given in
e.KeyChar (e is KeyPressEventArgs of course)
is NOT correctly converted ToString() when I type polish specific letters!
instead of the letter 'polish l' I get '3', instead of 'polish z' I get '?'
and so on.
it seems that the KeyChar reported in KeyPressEventHandler cannot handle
these specific letters. this bug seems to stick deeply inside the .NET
libraries because in any other case the polish specific letters are
correctly converted to their string equivalents.
I consider this as a painful bug, however I would really like to hear from
an expert about it. I am also really curious if this bug affects other
localized versions of W98 (for example german, french, turkish etc.)
Regards,
Wiktor Zychla
shortest example:
using System;
using System.Windows.Forms;
using System.Drawing;
public class CForm : Form
{
TextBox t;
public CForm()
{
t = new TextBox();
t.KeyPress += new KeyPressEventHandler( tkp );
this.Controls.Add( t );
}
// type any culture specific letter
// in polish W98 you will not see the letter you've typed
// it seems to be a severe bug
void tkp( object sender, KeyPressEventArgs e )
{
MessageBox.Show( e.KeyChar.ToString() );
}
public static void Main()
{
Application.Run( new CForm() );
}
}