keyboard input help!

Skip to first unread message

Lloyd Dupont

Dec 19, 2005, 1:29:16 AM12/19/05
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?

Michael (michka) Kaplan [MS]

Dec 19, 2005, 7:30:55 AM12/19/05
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

This posting is provided "AS IS" with
no warranties, and confers no rights.

"Lloyd Dupont" <net.galador@ld> wrote in message

Lloyd Dupont

Dec 19, 2005, 7:34:33 PM12/19/05
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...

Lloyd Dupont

NovaMind development team
NovaMind Software
Mind Mapping Software
"Michael (michka) Kaplan [MS]" <> wrote in
message news:uXMfKgJB...@TK2MSFTNGP14.phx.gbl...

Michael (michka) Kaplan [MS]

Dec 20, 2005, 2:33:52 PM12/20/05
Yes, but timing is important -- as is putting the code in the right event.


"Lloyd Dupont" <net.galador@ld> wrote in message


Reply all
Reply to author
0 new messages