keyboard input help!

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

I wrote my own C# TextBox (inherited from SWF.Control).
To do character input I'm overriding

protected virtual void OnKeyPress(KeyPressEventArgs e);

which has a property
public char KeyChar { get; set; }

However someone tried to enter some chineese character in my text box with
what he called "Microsoft's Simplified Chinese language insert tool" and he
reported various bug:
- display problem (that's probably a bug in my uniscribe wrapper)
- character double (when he wrote 2 character, he got twice the same)
- a few other..
which make me wonder, is there some special handling to do to input
international text?

Although I found some information on MSDN on IME, this is all win32 and .NET
documentation doesn't talk about that all, just like it should just work! by
overriding OnKeyPress, I suppose...

Any tip?
 
Does it happen with either GDI+ or GDI/Uniscribe? If so then I would blame
the insert to9ol, if not then it is probably your wrapper.

Though in truth, I think it is really neither. The real problem is that your
code is not in the right place. Rendering in owner draw controls is not to
be done in keypress events; it should be happening in paint events?


--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.
 
Of course it happens in Paint event!
But when there in an OnKeyPress, it's usually followed by an Invalidate(),
which leads to OnPaint() as we well know ;-)


I would wait for the customer to give me more information to know...
Out of curiosity I copy/pasted his chineese character without trouble, but
haven't typed them myself so far...

--
Regards,
Lloyd Dupont

NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com>
 
Yes, but timing is important -- as is putting the code in the right event.

MichKa
 
Back
Top