Re: space keys by Lloyd
Lloyd
Fri Nov 11 14:28:13 CST 2005
I am overiding SWF.Control (not SWF.TextBox).
I also have these various set style set:
SetStyle(ControlStyles.Opaque, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.ContainerControl, false);
SetStyle(ControlStyles.StandardClick, true);
SetStyle(ControlStyles.StandardDoubleClick, true);
SetStyle(ControlStyles.SupportsTransparentBackColor, false);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.UseTextForAccessibility, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.Selectable, true);
SetStyle(ControlStyles.UserMouse, true);
And my code is very simple indeed:
protected override void OnKeyPress(KeyPressEventArgs e)
{
base.OnKeyPress(e);
/// do something
// space don't come here
}
Truth to tell I override ProcessDialogKey, but I do nothing and return
base.ProcessDialogKeys() on SPACE
"Claes Bergefall" <claes.bergefall@nospam.com> wrote in message
news:%235a3%23Xr5FHA.2524@TK2MSFTNGP10.phx.gbl...
>I can't reproduce this. The standard textbox (correctly) generates KeyPress
> for
> both space and backspace
>
> /claes
>
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:OQJIFfo5FHA.2576@TK2MSFTNGP09.phx.gbl...
>> I'm writing a custom Text editor.
>> My idea was to override ProcessDialogKey to handle command keys, such as
> the
>> arrow or delete
>> and to override OnKeyPress to get char typed.
>>
>> Now I discover a few weird issues:
>> - the space key don't trigger OnKeyPress
>> - the backspace key does trigger OnKeyPress (with '\b')
>>
>> is it something normal (why is that) and stable (I could rely on next
>> version to be like that as well)?
>>
>>
>
>