[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Tab and Ctrl+I in a richtextbox

Fred

3/8/2008 1:50:00 PM

Hello,

I program a user control which display a RichTextBox and a format
ToolStrip.
I want to process some shortcut keys.
The RichTextBox accepts tab.
Ctrl + I is supposed to format the selection in italic.
But Ctrl+I is also de code for Tab.
So when I press Ctrl+I, a tab is inserted (replacing the current
selection) AND the new selection is formatted in italic.

How can I do this ? Do I have to inherit first the standard RichTextBox
and override the OnKeyDown method ?

--
Fred
foleide@free.fr

4 Answers

Fred

3/8/2008 2:05:00 PM

0

Dans : news:eXL2QNSgIHA.4376@TK2MSFTNGP05.phx.gbl,
Fred disait :
> Hello,
>
> I program a user control which display a RichTextBox and a format
> ToolStrip.
> I want to process some shortcut keys.
> The RichTextBox accepts tab.
> Ctrl + I is supposed to format the selection in italic.
> But Ctrl+I is also de code for Tab.
> So when I press Ctrl+I, a tab is inserted (replacing the current
> selection) AND the new selection is formatted in italic.
>
> How can I do this ? Do I have to inherit first the standard
> RichTextBox and override the OnKeyDown method ?

Of course not, just have to set the SuppressKeyPress property of the
KeyEventArgs parameter to false !!!

--
Fred
foleide@free.fr

Clay

3/13/2009 1:38:00 AM

0

On Mar 12, 8:31 pm, man, I love the fact that AKA Gary Roselles
follows me around USENET like a beaten, lost, confused puppy... here
boy <LOL>:


AKA Gary Roselles first brain-dead mistake:
<http://tinyurl.com/...

In the above post, you "told" me to use a newsgroup client. You even
mentioned a brand name. I then asked you if you knew how to read
HEADERS. You obviously didn't know what I was talking about b/c your
brain-dead reply was just too far off the mark.

AKA Gary Roselles second brain-dead mistake:
<http://tinyurl.com/...

I then posted the above... and you still didn't have a clue as to why
you were proven to be stupid... and how.

AKA Gary Roselles was too stupid to admit he's stupid <LOL>:
<http://tinyurl.com/...

It's no wonder why many folks (including "pyjamarama") kick your ass
all over USENET:

AKA Gary Roselles: "Compared to your intellect, I'm einstein"

Clay: "This is priceless... you choose a name which you can't even
Spell".

Too fucking funny.

-C-

Clay

3/13/2009 9:40:00 PM

0

On Mar 13, 5:35 pm, man, I love the fact that AKA Gary Roselles
follows me around USENET like a beaten, lost, confused puppy... here
boy <LOL>:
...

AKA Gary Roselles first brain-dead mistake:
<http://tinyurl.com/...

In the above post, you "told" me to use a newsgroup client. You even
mentioned a brand name. I then asked you if you knew how to read
HEADERS. You obviously didn't know what I was talking about b/c your
brain-dead reply was just too far off the mark.

AKA Gary Roselles second brain-dead mistake:
<http://tinyurl.com/...

I then posted the above... and you still didn't have a clue as to why
you were proven to be stupid... and how.

AKA Gary Roselles was too stupid to admit he's stupid <LOL>:
<http://tinyurl.com/...

It's no wonder why many folks (including "pyjamarama") kick your ass
all over USENET:

AKA Gary Roselles: "Compared to your intellect, I'm einstein"

Clay: "This is priceless... you choose a name which you can't even
Spell".

Too fucking funny.

-C-

Clay

3/14/2009 12:10:00 PM

0

On Mar 13, 8:04 pm, man, I love the fact that AKA Gary Roselles
follows me around USENET like a beaten, lost, confused puppy... here
boy <LOL>:
...

AKA Gary Roselles first brain-dead mistake:
<http://tinyurl.com/...

In the above post, you "told" me to use a newsgroup client. You even
mentioned a brand name. I then asked you if you knew how to read
HEADERS. You obviously didn't know what I was talking about b/c your
brain-dead reply was just too far off the mark.

AKA Gary Roselles second brain-dead mistake:
<http://tinyurl.com/...

I then posted the above... and you still didn't have a clue as to why
you were proven to be stupid... and how.

AKA Gary Roselles was too stupid to admit he's stupid <LOL>:
<http://tinyurl.com/...

It's no wonder why many folks (including "pyjamarama") kick your ass
all over USENET:

AKA Gary Roselles: "Compared to your intellect, I'm einstein"

Clay: "This is priceless... you choose a name which you can't even
Spell".

Too fucking funny.

-C-