Re: Escape Character \e does not work
Tom that is the better way to do it.
Thanks.
"Tom Porterfield" wrote:
[color=blue]
> pkaeowic wrote:[color=green]
> > I am having a problem with the "escape" character \e. This code is in my
> > Windows form KeyPress event. The compiler gives me "unrecogniz ed escape
> > sequence" even though this is documented in MSDN. Any idea if this is a
> > bug?
> >
> > if (e.KeyChar == '\e')
> > {
> > this.Close();
> > }[/color]
>
> You should look at doing the following instead:
>
> if (e.KeyChar == (char)Keys.Esca pe)
> {
> this.Close();
> }
>
> --
> Tom Porterfield
>[/color]
Tom that is the better way to do it.
Thanks.
"Tom Porterfield" wrote:
[color=blue]
> pkaeowic wrote:[color=green]
> > I am having a problem with the "escape" character \e. This code is in my
> > Windows form KeyPress event. The compiler gives me "unrecogniz ed escape
> > sequence" even though this is documented in MSDN. Any idea if this is a
> > bug?
> >
> > if (e.KeyChar == '\e')
> > {
> > this.Close();
> > }[/color]
>
> You should look at doing the following instead:
>
> if (e.KeyChar == (char)Keys.Esca pe)
> {
> this.Close();
> }
>
> --
> Tom Porterfield
>[/color]
Comment