Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 208817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:51:35+00:00 2026-05-11T17:51:35+00:00

I have typed in the following text in a control derived from Richtextbox The

  • 0

I have typed in the following text in a control derived from Richtextbox

“The world is {beautful}”.

My main intention is to create a link for the word beautful. I can create this using CFE_LINK , but that’s when I select the text.

When I use Select (4,9), the text within the range 4 to 9 gets deleted.

Can someone please help me with what I am missing out?

CODE :

I am creating a User Control, derived from Richtextbox.

I am giving the exact code below; I have not done any color change. I think the Select command sets the selected text to blue by default.

protected override void OnKeyPress(KeyPressEventArgs e)
{
   String keypressed =  e.KeyChar.ToString();
   if(keypressed == "}")
      Select(4,9)        
   base.OnKeyPress(e);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:51:35+00:00Added an answer on May 11, 2026 at 5:51 pm

    At first when I started messing with this, I was puzzled as well. But then it hit me, it’s very possible that your key that’s being pressed is being sent to the textbox to render at KeyUp. Sure enough, when I changed your code to this it worked:

        protected override void OnKeyUp(KeyEventArgs e)
        {
            base.OnKeyUp(e);
            if (e.KeyCode == Keys.Oem6)
            {
               Select(4, 9);
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For strongly-typed & type-safe solution, I have to do the following step. Create some
I have used following config of NLog to add the log text to control
I have a DIV like the following: <td> <DIV> <script type=text/javascript> // link to
I have the following text: --------------030805090908050805080502 Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-ID: <part16.07030906.00090703@highcontrast.ro> /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA
I have the following HTML: <input type=email id=email> I want to type text into
I have a control field where I dynamically add certain text. That works well
I have a field like the following: <div class=control-group> <label class=control-label for=lname>Last Name</label> <div
I have subclassed the RadioButtonList control in order to create a Control Adapter that
I have a web user control that generates the following html on the client.
I have an application whereby I dynamically create controls on a form from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.